mirror of
https://github.com/safing/portbase
synced 2025-09-10 15:34:26 +00:00
Add first part of query parser / Finish query building
This commit is contained in:
parent
6ed50f34fb
commit
115b18dfb6
17 changed files with 337 additions and 66 deletions
18
database/query/parser_test.go
Normal file
18
database/query/parser_test.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
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))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue