Show More
Commit Description:
Update .hgignore.
Commit Description:
Update .hgignore.
File last commit:
Show/Diff file:
Action:
test/project_checkup/core_property_test.clj
27 lines | 849 B | text/x-clojure | ClojureLexer
Add property-based testing (and fix a bug).
r8 (ns project-checkup.core-property-test
(:gen-class)
(:require [clojure.test :refer :all]
[project-checkup.core :refer :all]
[clojure.test.check :as tc]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]
[clojure.test.check.clojure-test :refer :all]))
;arguably redundant
(defspec get-extension-returns-string
100
(prop/for-all [st (gen/not-empty gen/string-ascii)
ext (gen/not-empty gen/string-alphanumeric) ]
(string? (get-extension (str st \. ext ))) ))
(defspec get-extension-returns-extension
100
(prop/for-all [st (gen/not-empty gen/string-ascii)
ext (gen/not-empty gen/string-alphanumeric) ]
(= (get-extension (str st \. ext ))
(str \. ext)) ))