Skip to content

Commit 3433d5f

Browse files
committed
CLJS-3335: test-and-or-code-gen-pass fails on Windows
1 parent a416e7f commit 3433d5f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/test/clojure/cljs/analyzer_pass_tests.clj

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
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

@@ -77,7 +78,7 @@
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;\nreturn ((true) && ((($SYM) || (false))));\n})()"
8384
"$SYM" (str local)))))))

src/test/clojure/cljs/test_util.clj

+6
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@
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.

0 commit comments

Comments
 (0)