(t *testing.T)
| 18 | ) |
| 19 | |
| 20 | func testStore(t *testing.T) *SimpleInMemoryStore { |
| 21 | t.Helper() |
| 22 | m := NewSimpleInMemoryStore() |
| 23 | facts := []ast.Atom{ |
| 24 | atom("baz()"), |
| 25 | atom("foo(`\n/bar`)"), |
| 26 | atom("foo(/zzz)"), |
| 27 | atom("bar(/r,1,/z)"), |
| 28 | atom("bar(/t,2,'😤')"), |
| 29 | atom("bar(/g,3,/h)"), |
| 30 | evalAtom("bar([/abc],4,/def)"), |
| 31 | evalAtom("bar([/abc, /def], 5, /def)"), |
| 32 | evalAtom("qaz([/abc : 123, /def : 345], 10, b'\\x80\\x81')"), |
| 33 | evalAtom("qaz({/abc : 456, /def : 678}, 20, /zzz)"), |
| 34 | } |
| 35 | for _, f := range facts { |
| 36 | m.Add(f) |
| 37 | } |
| 38 | if m.EstimateFactCount() != len(facts) { |
| 39 | t.Fatalf("SimpleInMemoryStore.EstimateFactCount() = %d want %d", m.EstimateFactCount(), len(facts)) |
| 40 | } |
| 41 | return &m |
| 42 | } |
| 43 | |
| 44 | func TestOutput(t *testing.T) { |
| 45 | m := testStore(t) |
no test coverage detected