File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1414 [cljs.compiler :as comp]
1515 [cljs.compiler-tests :as comp-tests :refer [compile-form-seq emit]]
1616 [cljs.env :as env]
17+ [cljs.test-util :refer [equiv-modulo-newlines]]
1718 [clojure.string :as string]
1819 [clojure.test :as test :refer [deftest is testing]]))
1920
7778 `(let [~local true ]
7879 (and true (or ~local false ))))
7980 code (with-out-str (emit ast))]
80- (is (= code
81+ (is (equiv-modulo-newlines code
8182 (string/replace
8283 " (function (){var $SYM = true;\n return ((true) && ((($SYM) || (false))));\n })()"
8384 " $SYM" (str local)))))))
Original file line number Diff line number Diff line change 7272 (with-out-str
7373 (run! println lines)))
7474
75+ (defn equiv-modulo-newlines
76+ " Returns whether strings are equivalent, disregarding differences in
77+ embedded system-dependent newlines."
78+ [s & more]
79+ (== 1 (count (group-by string/split-lines (list* s more)))))
80+
7581(defmethod clojure.test /assert-expr 'thrown-with-cause-msg? [msg form]
7682 ; ; (is (thrown-with-cause-msg? c re expr))
7783 ; ; Asserts that evaluating expr throws an exception of class c.
You can’t perform that action at this time.
0 commit comments