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

Function TestFiltered

factstore/simplecolumn_test.go:174–197  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

172}
173
174func TestFiltered(t *testing.T) {
175 m := testStore(t)
176 sc := SimpleColumn{true /* deterministic */}
177 var buf bytes.Buffer
178 if err := sc.WriteTo(m, &buf); err != nil {
179 t.Fatal(err)
180 }
181
182 s, err := NewSimpleColumnStore(func() (io.ReadCloser, error) {
183 return io.NopCloser(bytes.NewReader(buf.Bytes())), nil
184 })
185
186 if err != nil {
187 t.Fatal(err)
188 }
189
190 if !s.Contains(evalAtom("bar([/abc, /def], 5, /def)")) {
191 t.Errorf("Contains(bar([/abc, /def], 5, /def))=false want true")
192 }
193
194 if s.Contains(evalAtom("bar(/nope, /nope, /nope)")) {
195 t.Errorf("Contains(bar(/nope, /nope, /nope)=true want false")
196 }
197}
198
199func TestEmptyStore(t *testing.T) {
200 emptyStore := NewSimpleInMemoryStore()

Callers

nothing calls this directly

Calls 5

WriteToMethod · 0.95
ContainsMethod · 0.95
testStoreFunction · 0.85
NewSimpleColumnStoreFunction · 0.85
evalAtomFunction · 0.70

Tested by

no test coverage detected