Skip to content

Commit 681f921

Browse files
committed
Get all CLJS tests compiling (if not passing)
1 parent 696e3e7 commit 681f921

File tree

101 files changed

+1248
-1014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1248
-1014
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ pom.xml.asc
1515
/.lsp
1616
*~
1717
.*.swp
18+
/node_modules
19+
/.shadow-cljs

shadow-cljs.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
:output-to "target/js/node-tests.js"
1111
:ns-regexp "-test"
1212
:autorun true
13+
:compiler-options {:warnings {:invalid-arithmetic false}}
1314
:release {:autorun false}}}}

shell.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
with (import <nixpkgs> {});
2+
mkShell
3+
{
4+
buildInputs =
5+
[
6+
leiningen
7+
openjdk
8+
nodejs
9+
];
10+
shellHook =
11+
''
12+
'';
13+
}

test/clojure/core_test/abs.cljc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(ns clojure.core-test.abs
2-
(:require [clojure.test :as t :refer [deftest testing is are]]
3-
[clojure.core-test.portability :as p]))
2+
(:require #?(:cljs [cljs.reader])
3+
[clojure.test :as t :refer [deftest testing is are]]
4+
[clojure.core-test.portability #?(:cljs :refer-macros :default :refer) [when-var-exists]]))
45

5-
(p/when-var-exists clojure.core/abs
6+
(when-var-exists clojure.core/abs
67
(deftest test-abs
78
(testing "common"
89
(are [in ex] (= ex (abs in))
@@ -15,9 +16,11 @@
1516
##Inf ##Inf
1617
-123.456M 123.456M
1718
-123N 123N
18-
-1/5 1/5)
19+
#?@(:cljs []
20+
:default
21+
[-1/5 1/5]))
1922
(is (NaN? (abs ##NaN)))
20-
(is (thrown? NullPointerException (abs nil))))
23+
(is (thrown? #?(:cljs :default :clj NullPointerException) (abs nil))))
2124

2225
(testing "unboxed"
2326
(let [a 42

test/clojure/core_test/aclone.cljc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(ns clojure.core-test.aclone
2-
(:require [clojure.test :as t :refer [deftest testing is are]]
3-
[clojure.core-test.portability :as p]))
2+
(:require #?(:cljs [cljs.reader])
3+
[clojure.test :as t :refer [deftest testing is are]]
4+
[clojure.core-test.portability #?(:cljs :refer-macros :default :refer) [when-var-exists]]))
45

5-
(p/when-var-exists clojure.core/aclone
6+
(when-var-exists clojure.core/aclone
67
(defn clone-test
78
[a b]
89
(aset a 0 1)

0 commit comments

Comments
 (0)