Skip to content

Commit f40af10

Browse files
neuter overspecified tests
1 parent 154c88c commit f40af10

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

test/clojure/test_clojure/protocols.clj

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -396,25 +396,21 @@
396396
(is (= (RecordToTestLongHint. 42) (map->RecordToTestLongHint {:a 42})))
397397
(is (= (RecordToTestLongHint. 42) (->RecordToTestLongHint 42)))
398398
(testing "that invalid primitive types on hinted defrecord fields fails"
399-
(is (thrown-with-msg?
399+
(is (thrown?
400400
ClassCastException
401-
#"java.lang.String cannot be cast to java.lang.Long.*"
402401
(read-string "#clojure.test_clojure.protocols.RecordToTestLongHint{:a \"\"}")))
403402
(is (thrown-with-msg?
404403
IllegalArgumentException
405404
#"Unexpected param type, expected: long, given: java.lang.String.*"
406405
(read-string "#clojure.test_clojure.protocols.RecordToTestLongHint[\"\"]")))
407-
(is (thrown-with-msg?
406+
(is (thrown?
408407
ClassCastException
409-
#"java.lang.String cannot be cast to java.lang.Long.*"
410408
(clojure.test_clojure.protocols.RecordToTestLongHint/create {:a ""})))
411-
(is (thrown-with-msg?
409+
(is (thrown?
412410
ClassCastException
413-
#"java.lang.String cannot be cast to java.lang.Long.*"
414411
(map->RecordToTestLongHint {:a ""})))
415-
(is (thrown-with-msg?
412+
(is (thrown?
416413
ClassCastException
417-
#"java.lang.String cannot be cast to java.lang.Number.*"
418414
(->RecordToTestLongHint "")))))
419415
(testing "that primitive hinting requiring coercion works as expected"
420416
(is (= (RecordToTestByteHint. 42) (clojure.test_clojure.protocols.RecordToTestByteHint/create {:a (byte 42)})))

0 commit comments

Comments
 (0)