mirror of
https://github.com/safing/portbase
synced 2025-09-02 10:40:39 +00:00
18 lines
414 B
Go
18 lines
414 B
Go
package query
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestMakeTree(t *testing.T) {
|
|
text1 := `(age > 100 and experience <= "99") or (age < 10 and motivation > 50) or name matches Mr.\"X or name matches y`
|
|
snippets, err := extractSnippets(text1)
|
|
if err != nil {
|
|
t.Errorf("failed to make tree: %s", err)
|
|
} else {
|
|
for _, el := range snippets {
|
|
t.Errorf("%+v", el)
|
|
}
|
|
}
|
|
// t.Error(spew.Sprintf("%v", treeElement))
|
|
}
|