(t *testing.T)
| 925 | } |
| 926 | |
| 927 | func TestBoundsAnalyzerWithNames(t *testing.T) { |
| 928 | test := newBoundsTestCaseWithNameTrie(t, []ast.Clause{ |
| 929 | clause("a(X) :- b(X)."), |
| 930 | }, []ast.Decl{ |
| 931 | makeSimpleDecl(atom("a(X)"), name("/foo")), |
| 932 | makeSimpleDecl(atom("b(X)"), name("/foo")), |
| 933 | }, |
| 934 | symbols.NewNameTrie().Add([]string{"foo"}), |
| 935 | ) |
| 936 | bc, err := newBoundsAnalyzer(&test.programInfo, test.nameTrie, []ast.Atom{atom("b(/foo/bar)")}, test.rulesMap) |
| 937 | if err != nil { |
| 938 | t.Fatal(err) |
| 939 | } |
| 940 | if err := bc.BoundsCheck(); err != nil { |
| 941 | t.Errorf("BoundsCheck(%v, %v) returns error when it shouldn't: %v", test.programInfo, test.rulesMap, err) |
| 942 | } |
| 943 | } |
| 944 | |
| 945 | func TestBoundsAnalyzerWithManyInitialFacts(t *testing.T) { |
| 946 | test := newBoundsTestCaseWithNameTrie(t, []ast.Clause{ |
nothing calls this directly
no test coverage detected