Source

clj-uuid / test / uuid_test.clj

Full commit
(ns uuid-test
  (:use [clojure.test]
        [uuid]))

(deftest uuid-test
  (is (instance? java.lang.String (uuid)))
  (is (instance? java.lang.String (re-find #"^[0-9a-f-]+$" (uuid))))
  (is (= (count (uuid)) 36)))

(deftest name-uuid-test
  (is (instance? java.lang.String (name-uuid "foo")))
  (is (instance? java.lang.String (re-find #"^[0-9a-f-]+$" (name-uuid "blah"))))
  (is (= (count (name-uuid "zzz")) 36))
  (is (= (name-uuid "same") (name-uuid "same"))))