Last active
February 14, 2017 19:54
-
-
Save c-garcia/8b7d5a7d7af612b68bd092c819e366f9 to your computer and use it in GitHub Desktop.
Clojure file predicate with ert tests.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun clojure-file-p (file-name) | |
"Determines if a file-name belongs to a clojure file." | |
(string-match "clj[csx]?$" file-name)) | |
(ert-deftest hola () | |
(should (not (clojure-file-p "hola.cl"))) | |
(should (not (clojure-file-p ""))) | |
(should (not (clojure-file-p "c"))) | |
(should (clojure-file-p "hola.clj")) | |
(should (clojure-file-p "hola.cljs")) | |
(should (clojure-file-p "hola.cljx")) | |
(should (clojure-file-p "src/hola.clj")) | |
(should (clojure-file-p "hola.cljc"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment