MCPcopy
hub / github.com/google/mangle / TestBoundsAnalyzerWithNamesNegative

Function TestBoundsAnalyzerWithNamesNegative

analysis/validation_test.go:967–982  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

965}
966
967func TestBoundsAnalyzerWithNamesNegative(t *testing.T) {
968 test := newBoundsTestCaseWithNameTrie(t, []ast.Clause{
969 clause("a(X) :- b(X)."),
970 }, []ast.Decl{
971 makeSimpleDecl(atom("a(X)"), name("/foo")),
972 },
973 symbols.NewNameTrie().Add([]string{"foo"}),
974 )
975 bc, err := newBoundsAnalyzer(&test.programInfo, test.nameTrie, nil, test.rulesMap)
976 if err != nil {
977 t.Fatal(err)
978 }
979 if err := bc.BoundsCheck(); err == nil {
980 t.Errorf("BoundsCheck(%v, %v) should have returned error but did not", test.programInfo, test.rulesMap)
981 }
982}
983func TestBoundOfArgTimeDuration(t *testing.T) {
984 // Setup a minimal analyzer/context if needed, or just test boundOfArg directly if possible.
985 // boundOfArg is private, so we need to test it via exported function or be in the same package.

Callers

nothing calls this directly

Calls 9

NewNameTrieFunction · 0.92
makeSimpleDeclFunction · 0.85
newBoundsAnalyzerFunction · 0.85
BoundsCheckMethod · 0.80
clauseFunction · 0.70
atomFunction · 0.70
nameFunction · 0.70
AddMethod · 0.65

Tested by

no test coverage detected