Skip to content

Commit cc55448

Browse files
committed
fix tests about properties and add support go module
1 parent 76ea040 commit cc55448

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

evaluator_test.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,13 @@ func TestProperties(t *testing.T) {
295295
{
296296
expr: `(or
297297
(and
298-
(between age 18 80)
298+
(between AGE 18 80)
299299
(eq gender "male")
300300
(between app_version (t_version "2.7.1") (t_version "2.9.1"))
301301
)
302302
(overlap region (2890 3780))
303303
)`,
304-
res: []string{"age", "gender", "app_version", "region"},
304+
res: []string{"AGE", "gender", "app_version", "region"},
305305
},
306306
{
307307
expr: `(and
@@ -311,6 +311,14 @@ func TestProperties(t *testing.T) {
311311
)`,
312312
res: []string{"os", "app_version", "os", "affiliate", "os", "language"},
313313
},
314+
{
315+
expr: `(eq 1 1)`,
316+
res: nil,
317+
},
318+
{
319+
expr: `(and () ())`,
320+
res: nil,
321+
},
314322
}
315323
for _, input := range inputs {
316324
e, err := New(input.expr)

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/nullne/evaluator
2+
3+
go 1.14

0 commit comments

Comments
 (0)