File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 234234 (is (= " dude" (tu/eval* " (deftype Dude [] Object (toString [_] \" dude\" )) (str (->Dude))" {})))
235235 #? (:clj (is (= [true false ] (tu/eval* " (deftype Dude [x] Object (toString [_] (str x)) (equals [this other] (= (str this) (str other)))) [(= (->Dude 1) (->Dude 1)) (= (->Dude 1) (->Dude 2))]" {}))))
236236 #? (:clj (is (true ? (tu/eval* " (deftype Dude [x] Object (hashCode [_] 1))
237- (deftype Dude2 [x]) (and (= 1 (hash (Dude. 1337))) (not= 1 (hash (Dude2. nil))))" {})))))
237+ (deftype Dude2 [x]) (and (= 1 (hash (Dude. 1337))) (not= 1 (hash (Dude2. nil))))" {}))))
238+ ; ; (str Type) returns "user.Foo", not "class user.Foo" like java.lang.Class.
239+ ; ; Downstream libs (e.g. prismatic/schema) depend on this.
240+ (is (= " user.Dude" (tu/eval* " (defrecord Dude []) (str Dude)" {})))
241+ (is (= " user.Dude" (tu/eval* " (deftype Dude []) (str Dude)" {}))))
238242
239243(deftest equiv-test
240244 (let [prog " (defrecord Foo [a]) (defrecord Bar [a]) [(= (->Foo 1) (->Foo 1)) (= (->Foo 1) (->Bar 1)) (= (->Foo 1) {:a 1})]" ]
You can’t perform that action at this time.
0 commit comments