default list matcher to has

This commit is contained in:
Caleb Doxsey 2024-10-23 12:18:14 -06:00
parent e0e6b9a8d7
commit ffa6f46a79
2 changed files with 2 additions and 2 deletions

View file

@ -66,7 +66,7 @@ func matchStringList(dst *ast.Body, left *ast.Term, right parser.Value) error {
str, ok := right.(parser.String)
if ok {
right = parser.Object{
"is": str,
"has": str,
}
}

View file

@ -98,6 +98,6 @@ func TestStringListMatcher(t *testing.T) {
var body ast.Body
err := matchStringList(&body, ast.VarTerm("example"), parser.String("test"))
require.NoError(t, err)
assert.Equal(t, `count(example) == 1`+"\n"+`count([true | some v; v = example[_]; v == "test"]) > 0`, str(body))
assert.Equal(t, `count([true | some v; v = example[_]; v == "test"]) > 0`, str(body))
})
}