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

Function TestBoundsAnalyzerWithNames

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

Source from the content-addressed store, hash-verified

925}
926
927func 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
945func TestBoundsAnalyzerWithManyInitialFacts(t *testing.T) {
946 test := newBoundsTestCaseWithNameTrie(t, []ast.Clause{

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