(t *testing.T)
| 943 | } |
| 944 | |
| 945 | func TestBoundsAnalyzerWithManyInitialFacts(t *testing.T) { |
| 946 | test := newBoundsTestCaseWithNameTrie(t, []ast.Clause{ |
| 947 | clause("a(X) :- b(X)."), |
| 948 | }, []ast.Decl{ |
| 949 | makeSimpleDecl(atom("a(X)"), name("/foo")), |
| 950 | makeSimpleDecl(atom("b(X)"), name("/foo")), |
| 951 | }, |
| 952 | symbols.NewNameTrie().Add([]string{"foo"}), |
| 953 | ) |
| 954 | var facts []ast.Atom |
| 955 | for i := 0; i < 100000; i++ { |
| 956 | facts = append(facts, atom(fmt.Sprintf("b(/foo/bar%d)", i))) |
| 957 | } |
| 958 | bc, err := newBoundsAnalyzer(&test.programInfo, test.nameTrie, facts, test.rulesMap) |
| 959 | if err != nil { |
| 960 | t.Fatal(err) |
| 961 | } |
| 962 | if err := bc.BoundsCheck(); err != nil { |
| 963 | t.Errorf("BoundsCheck(%v, %v) returns error when it shouldn't: %v", test.programInfo, test.rulesMap, err) |
| 964 | } |
| 965 | } |
| 966 | |
| 967 | func TestBoundsAnalyzerWithNamesNegative(t *testing.T) { |
| 968 | test := newBoundsTestCaseWithNameTrie(t, []ast.Clause{ |
nothing calls this directly
no test coverage detected