From edadbd469bad735d4a66230ece58a13bfadff5dc Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Wed, 13 Aug 2014 19:23:04 +0100 Subject: [PATCH] Added tests for mw-parser.bulk --- test/mw_parser/bulk_test.clj | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/mw_parser/bulk_test.clj diff --git a/test/mw_parser/bulk_test.clj b/test/mw_parser/bulk_test.clj new file mode 100644 index 0000000..e80acc7 --- /dev/null +++ b/test/mw_parser/bulk_test.clj @@ -0,0 +1,24 @@ +(ns mw-parser.bulk-test + (:use clojure.java.io) + (:require [clojure.test :refer :all] + [mw-parser.bulk :refer :all])) + +(deftest bulk-parsing-test + (testing "Bulk (file) parsing and compilation" + (is (= (count (parse-file (as-file "resources/rules.txt"))) 15) + "Should parse all rules and throw no exceptions") + (is (empty? + (remove #(= % 'fn) + (map first + (parse-file + (as-file "resources/rules.txt"))))) + "all parsed rules should be lambda sexprs") + (is (= (count (compile-file (as-file "resources/rules.txt"))) 15) + "Should compile all rules and throw no exceptions") + (is (empty? + (remove ifn? + (map first + (compile-file + (as-file "resources/rules.txt"))))) + "all compiled rules should be ifns") + ))