Skip to content

Commit 838785d

Browse files
authored
Catch jank up (#901)
1 parent c7bfcb5 commit 838785d

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

test/clojure/core_test/portability.cljc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@
3737
sort, typically for whether `x` conforms to a specific object type."
3838
[x]
3939
#?(:cljs (instance? LazySeq x)
40-
:phel (phel.core/lazy-seq? x)
4140
:lpy (instance? basilisp.lang.seq/LazySeq x)
41+
:phel (phel.core/lazy-seq? x)
42+
:jank (cpp/== (.get_type x) cpp/jank.runtime.object_type.lazy_sequence)
4243
:default (instance? clojure.lang.LazySeq x)))
4344

4445
;; --- Portable exception multimethod. ---
@@ -85,6 +86,13 @@
8586
e#)
8687
(catch ~'std.exception e#
8788
(let [actual# (~'.what e#)]
89+
(t/do-report {:type :pass
90+
:message ~msg
91+
:expected '~form
92+
:actual actual#})
93+
actual#))
94+
(catch ~'jank.error_ref e#
95+
(let [actual# (~'.-message (cpp/* e#))]
8896
(t/do-report {:type :pass
8997
:message ~msg
9098
:expected '~form
@@ -110,7 +118,7 @@
110118

111119
:phel
112120
;; Phel's `phel.test/report` multimethod dispatches on `:type` and only
113-
;; recognises `:pass`/`:failed`/`:error` not Clojure's `:fail`. Use
121+
;; recognises `:pass`/`:failed`/`:error`, not Clojure's `:fail`. Use
114122
;; phel-native event keys so the assertion counters update. Phel's
115123
;; throwable hierarchy is rooted at PHP's `\Throwable`; the literal is
116124
;; constructed via `symbol` because Clojure's reader treats a bare `\T`

0 commit comments

Comments
 (0)