(class x) returns a JVM-faithful Class value
class / .getClass now return a Class value that renders like the JVM — (str c)/.toString -> "class <name>", pr -> "<name>", .getName/.getSimpleName/ .getCanonicalName work — but stays = and hash equal to its name string, so (= (class x) String), class-keyed maps, multimethod dispatch on class, and instance? keep working against the bare class-name tokens. instance? unwraps a Class passed as the type arg. clojure.test/class-match? no longer assumes (class e) is a string (a jolt-ism; on the JVM a Class isn't a string either) — reads the name via .getName. Matches JVM Class.toString, which libraries surface in error messages (clojure.data.json DJSON-54 expects "...of class java.net.URI"). data.json suite 139/139 bar the one UTF-16 surrogate test (Unicode-scalar char model). 5 corpus rows certified vs JVM; make test + shakesmoke green, 0 new divergences.
This commit is contained in:
parent
9092b30f8b
commit
8c7b98e5f2
5 changed files with 43 additions and 8 deletions
|
|
@ -74,8 +74,9 @@
|
|||
(let [w (last-seg wanted)]
|
||||
(if (or (= w "Exception") (= w "Throwable"))
|
||||
true
|
||||
(let [c (class e)]
|
||||
(and (string? c) (= (last-seg c) w))))))
|
||||
(let [c (class e)
|
||||
cn (cond (nil? c) nil (string? c) c :else (.getName c))]
|
||||
(and cn (= (last-seg cn) w))))))
|
||||
|
||||
;; --- assertion macros ------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue