File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 14
14
[cljs.compiler :as comp]
15
15
[cljs.compiler-tests :as comp-tests :refer [compile-form-seq emit]]
16
16
[cljs.env :as env]
17
+ [cljs.test-util :refer [equiv-modulo-newlines]]
17
18
[clojure.string :as string]
18
19
[clojure.test :as test :refer [deftest is testing]]))
19
20
77
78
`(let [~local true ]
78
79
(and true (or ~local false ))))
79
80
code (with-out-str (emit ast))]
80
- (is (= code
81
+ (is (equiv-modulo-newlines code
81
82
(string/replace
82
83
" (function (){var $SYM = true;\n return ((true) && ((($SYM) || (false))));\n })()"
83
84
" $SYM" (str local)))))))
Original file line number Diff line number Diff line change 72
72
(with-out-str
73
73
(run! println lines)))
74
74
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
+
75
81
(defmethod clojure.test /assert-expr 'thrown-with-cause-msg? [msg form]
76
82
; ; (is (thrown-with-cause-msg? c re expr))
77
83
; ; Asserts that evaluating expr throws an exception of class c.
You can’t perform that action at this time.
0 commit comments