File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -80,3 +80,32 @@ describe "js-ast-test", ->
8080 for expression, expected of expressions
8181 compiled = (js_ast clj_ast ast expression)
8282 expect (compiled).to .equal expected
83+
84+ describe " RiemannQuery#fun" , ->
85+ fn = null
86+ expression = " host ~= \" ^local[a-z]+\" and state = 1e4"
87+
88+ beforeEach ->
89+ fn = fun ast expression
90+
91+ afterEach ->
92+ fn = null
93+
94+ it " should return a function" , ->
95+ expect (fn).to .be .a " function"
96+
97+ it " should return true when an object matches the expression" , ->
98+ event =
99+ host : " localhost"
100+ state : 10000
101+
102+ match = fn event
103+ expect (match).to .be .true
104+
105+ it " should return false when an object doesn not match the expression" , ->
106+ event =
107+ host : " localhost"
108+ state : 9999
109+
110+ match = fn event
111+ expect (match).to .be .false
You can’t perform that action at this time.
0 commit comments