1. The regression test failures were both errors in the tests rather than in the code under test; 2. The failure in the 'bulk' test relates to the fact that the new declarative parser cannot cope with trailing whitespace.
26 lines
1.1 KiB
Clojure
26 lines
1.1 KiB
Clojure
(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 #(= % ':RULE)
|
|
(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")
|
|
))
|
|
|