Skip to content

Commit

Permalink
fix tests about properties and add support go module
Browse files Browse the repository at this point in the history
  • Loading branch information
nullne committed Jun 23, 2020
1 parent 76ea040 commit cc55448
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 10 additions & 2 deletions evaluator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,13 @@ func TestProperties(t *testing.T) {
{
expr: `(or
(and
(between age 18 80)
(between AGE 18 80)
(eq gender "male")
(between app_version (t_version "2.7.1") (t_version "2.9.1"))
)
(overlap region (2890 3780))
)`,
res: []string{"age", "gender", "app_version", "region"},
res: []string{"AGE", "gender", "app_version", "region"},
},
{
expr: `(and
Expand All @@ -311,6 +311,14 @@ func TestProperties(t *testing.T) {
)`,
res: []string{"os", "app_version", "os", "affiliate", "os", "language"},
},
{
expr: `(eq 1 1)`,
res: nil,
},
{
expr: `(and () ())`,
res: nil,
},
}
for _, input := range inputs {
e, err := New(input.expr)
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/nullne/evaluator

go 1.14

0 comments on commit cc55448

Please sign in to comment.