File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change 292
292
{:x 42 })))))
293
293
294
294
(def x " x" )
295
- (p/defpattern constant-pattern [(:x x)])
296
- (def p (p/parse-pattern '[(:x x)]))
295
+ (p/defpattern constant-pattern [(X x)])
296
+ (def p (p/parse-pattern '[(X x)]))
297
297
298
298
(t/deftest closes-over-outer-variables-test
299
299
(t/testing " with compare-fn"
300
- (let [evt {:x " x" }]
300
+ (let [evt {" X " " x" }]
301
301
(t/is (= " x"
302
- ((p/map-matcher [(:x (:compare-fn #(= % (:x evt))))] x)
302
+ ((p/map-matcher [(X (:compare-fn #(= % (get evt " X " ))))] x)
303
303
evt)))))
304
304
(t/testing " as local constant"
305
305
(let [x " x"
306
- evt {:x x}]
306
+ evt {" X " x}]
307
307
(t/is (= x
308
- ((p/map-matcher [(:x x)] x)
308
+ ((p/map-matcher [(X x)] x)
309
309
evt)))))
310
310
(t/testing " as global constant"
311
- (let [evt {:x x}]
311
+ (let [evt {" X " x}]
312
312
(t/is (= x
313
- ((p/map-matcher [(:x x)] x)
313
+ ((p/map-matcher [(X x)] x)
314
314
evt)))))
315
315
(t/testing " as constant with global defpattern"
316
316
(let [x " x"
317
- evt {:x x}]
317
+ evt {" X " x}]
318
318
(t/is (= x
319
319
((p/map-matcher constant-pattern x)
320
320
evt)))))
321
321
(t/testing " as constant with global parse-pattern"
322
- (let [evt {:x x}]
322
+ (let [evt {" X " x}]
323
323
(t/is (= x
324
324
((p/map-matcher p x)
325
325
evt)))))
326
326
(t/testing " as constant with global defpattern"
327
327
(let [x " x"
328
- evt {:x x}]
329
- (p/defpattern p [(:x x)])
328
+ evt {" X " x}]
329
+ (p/defpattern p [("X" x)])
330
330
(t/is (= x
331
331
((p/map-matcher p x)
332
332
evt)))))
333
333
#_ (t/testing " as constant with local parse-pattern"
334
334
(let [x " x"
335
- evt {:x x}
336
- p (p/parse-pattern [(:x x)])]
335
+ evt {" X " x}
336
+ p (p/parse-pattern [(X x)])]
337
337
(t/is (= x
338
338
((p/map-matcher p x)
339
339
evt))))))
You can’t perform that action at this time.
0 commit comments