File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -422,7 +422,7 @@ specified, return speced vars from all namespaces."
422
422
`(let [st# (inst-ms ~start)
423
423
et# (inst-ms ~end)
424
424
mkdate# (fn [d#] (js/Date. d#))]
425
- (spec (and inst? #(inst-in-range? ~start ~end %))
425
+ (spec (and inst? #(cljs.spec/ inst-in-range? ~start ~end %))
426
426
:gen (fn []
427
427
(gen/fmap mkdate#
428
428
(gen/large-integer* {:min st# :max et#}))))))
@@ -431,7 +431,7 @@ specified, return speced vars from all namespaces."
431
431
" Returns a spec that validates longs in the range from start
432
432
(inclusive) to end (exclusive)."
433
433
[start end]
434
- `(spec (and c/int? #(int-in-range? ~start ~end %))
434
+ `(spec (and c/int? #(cljs.spec/ int-in-range? ~start ~end %))
435
435
:gen #(gen/large-integer* {:min ~start :max (dec ~end)})))
436
436
437
437
(defmacro instrument
Original file line number Diff line number Diff line change 43
43
(is (= " good" (testmm {:type :good })))
44
44
(is (thrown? js/Error (testmm " foo" ))))
45
45
46
+ (deftest int-in-test
47
+ (is (s/valid? (s/int-in 1 3 ) 2 ))
48
+ (is (not (s/valid? (s/int-in 1 3 ) 0 ))))
49
+
50
+ (deftest inst-in-test
51
+ (is (s/valid? (s/inst-in #inst " 1999" #inst " 2001" ) #inst " 2000" ))
52
+ (is (not (s/valid? (s/inst-in #inst " 1999" #inst " 2001" ) #inst " 1492" ))))
53
+
46
54
(comment
47
55
48
56
(s/conform s2 [42 11 13 15 {:a 1 :b 2 :c 3 } 1 2 3 42 43 44 11 ])
You can’t perform that action at this time.
0 commit comments