File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ (ns clojure.core-test.uuid-qmark
2+ (:require [clojure.test :refer [are deftest testing]]
3+ [clojure.core-test.portability #?(:cljs :refer-macros :default :refer ) [when-var-exists ]]))
4+
5+ (when-var-exists uuid?
6+
7+ (deftest test-uuid?
8+ (testing " uuids"
9+ (are [x] (uuid? x)
10+ #uuid " 0-0-0-0-0"
11+ #uuid " f81d4fae-7dec-11d0-a765-00a0c91e6bf6"
12+ (parse-uuid " f81d4fae-7dec-11d0-a765-00a0c91e6bf6" )
13+ (random-uuid )))
14+
15+ (when-var-exists read-string
16+ (testing " more uuids"
17+ (read-string " #uuid \" f81d4fae-7dec-11d0-a765-00a0c91e6bf6\" " )))
18+
19+ (testing " not uuids"
20+ (are [x] (not (uuid? x))
21+ nil
22+ true
23+ false
24+ 0
25+ 1
26+ -1
27+ 0.0
28+ 1.0
29+ -1.0
30+ ##NaN
31+ ##Inf
32+ " f81d4fae-7dec-11d0-a765-00a0c91e6bf6"
33+ {:a :map }
34+ #{:a-set }
35+ [:a :vector ]
36+ '(:a :list )
37+ :a-keyword
38+ 'a-symbol
39+ (range )
40+ \a))))
You can’t perform that action at this time.
0 commit comments