File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 280
280
281
281
(s/def ::regex regex? )
282
282
(s/def ::compare-fn-token #{:compare-fn })
283
- (s/def ::compare-fn (s/cat :binding symbol? : compare-fn ::compare-fn-token :fn ifn?))
283
+ (s/def ::compare-fn (s/cat :compare-fn ::compare-fn-token :fn ifn?))
284
284
285
285
(s/def ::or-token #{:or })
286
286
Original file line number Diff line number Diff line change 57
57
58
58
(t/testing " with a predicate matcher"
59
59
(t/is (= (p/make-key-matches-clause :k (p/make-predicate-matcher even?) 'Binding)
60
- (p/parse-clause (list :k (list 'k :compare-fn even?) :as 'Binding))))
60
+ (p/parse-clause (list :k (list :compare-fn even?) :as 'Binding))))
61
61
(t/is (= (p/make-key-matches-clause :k (p/make-predicate-matcher (f/partial = 42 )) 'Binding)
62
- (p/parse-clause (list :k (list 'k :compare-fn (f/partial = 42 )) :as 'Binding)))))
62
+ (p/parse-clause (list :k (list :compare-fn (f/partial = 42 )) :as 'Binding)))))
63
63
64
64
(t/testing " optional clauses"
65
65
(t/is (= (p/make-optional-clause (p/make-key-exists-clause :k p/the-existence-matcher 'k))
210
210
211
211
(def predicate-matcher
212
212
(p/map-matcher
213
- [(:x (x :compare-fn even?))] ::even
214
- [(:x (x :compare-fn odd?))] ::odd ))
213
+ [(:x (:compare-fn even?))] ::even
214
+ [(:x (:compare-fn odd?))] ::odd ))
215
215
216
216
(t/deftest map-matcher-predicate-test
217
217
(t/is (= ::even (predicate-matcher {:x 42 })))
218
218
(t/is (= ::odd (predicate-matcher {:x 41 }))))
219
219
220
220
(p/defpattern predicate-pattern
221
- [(:x (x :compare-fn even?))])
221
+ [(:x (:compare-fn even?))])
222
222
223
223
(t/deftest map-matcher-polymorphism-test
224
224
(t/testing " works with a pattern record"
228
228
229
229
(t/testing " works with pattern syntax"
230
230
(t/is (= ::even
231
- ((p/map-matcher [(:x (x :compare-fn even?))] ::even )
231
+ ((p/map-matcher [(:x (:compare-fn even?))] ::even )
232
232
{:x 42 })))))
You can’t perform that action at this time.
0 commit comments