File tree Expand file tree Collapse file tree 18 files changed +60
-60
lines changed
Expand file tree Collapse file tree 18 files changed +60
-60
lines changed Original file line number Diff line number Diff line change 1414 )
1515
1616 (is (thrown? IllegalArgumentException (char -1 )))
17- (is (thrown? Exception (char nil )))))
17+ (is (thrown? #?( :cljs :default :default Exception) (char nil )))))
Original file line number Diff line number Diff line change 1010 (is (= 3 (denominator 2/3 )))
1111 (is (= 4 (denominator 3/4 )))
1212
13- (is (thrown? Exception (denominator 1 )))
14- (is (thrown? Exception (denominator 1.0 )))
15- (is (thrown? Exception (denominator 1N )))
16- (is (thrown? Exception (denominator 1.0M )))
17- (is (thrown? Exception (denominator ##Inf )))
18- (is (thrown? Exception (denominator ##NaN )))
19- (is (thrown? Exception (denominator nil ))))))
13+ (is (thrown? #?( :cljs :default :default Exception) (denominator 1 )))
14+ (is (thrown? #?( :cljs :default :default Exception) (denominator 1.0 )))
15+ (is (thrown? #?( :cljs :default :default Exception) (denominator 1N )))
16+ (is (thrown? #?( :cljs :default :default Exception) (denominator 1.0M )))
17+ (is (thrown? #?( :cljs :default :default Exception) (denominator ##Inf )))
18+ (is (thrown? #?( :cljs :default :default Exception) (denominator ##NaN )))
19+ (is (thrown? #?( :cljs :default :default Exception) (denominator nil ))))))
Original file line number Diff line number Diff line change 2121 (is (= 42 (var-get x-var))))
2222
2323 ; ; Trying to intern to an unknown namespace should throw
24- (is (thrown? Exception (intern 'unknown-namespace 'x)))
25- (is (thrown? Exception (intern 'unknonw-namespace 'x 42 )))))
24+ (is (thrown? #?( :cljs :default :default Exception) (intern 'unknown-namespace 'x)))
25+ (is (thrown? #?( :cljs :default :default Exception) (intern 'unknonw-namespace 'x 42 )))))
Original file line number Diff line number Diff line change 7878
7979 (is (nil? (keyword nil ))) ; (keyword nil) => nil, surprisingly
8080 (is (= :abc (keyword nil " abc" ))) ; But if ns is nil, it just ignores it.
81- (is (thrown? Exception (keyword " abc" nil ))) ; But if name is nil, then we throw.
81+ (is (thrown? #?( :cljs :default :default Exception) (keyword " abc" nil ))) ; But if name is nil, then we throw.
8282
8383 ; ; Two arg version requires namespace and symbol to be a string, not
8484 ; ; a symbol or keyword like the one arg version.
85- (is (thrown? Exception (keyword 'abc " abc" )))
86- (is (thrown? Exception (keyword " abc" 'abc)))
87- (is (thrown? Exception (keyword :abc " abc" )))
88- (is (thrown? Exception (keyword " abc" :abc )))))
85+ (is (thrown? #?( :cljs :default :default Exception) (keyword 'abc " abc" )))
86+ (is (thrown? #?( :cljs :default :default Exception) (keyword " abc" 'abc)))
87+ (is (thrown? #?( :cljs :default :default Exception) (keyword :abc " abc" )))
88+ (is (thrown? #?( :cljs :default :default Exception) (keyword " abc" :abc )))))
Original file line number Diff line number Diff line change 6969
7070 ; ; Zero arg
7171 #?(:cljs nil
72- :default (is (thrown? Exception (- ))))
72+ :default (is (thrown? #?( :cljs :default :default Exception) (- ))))
7373
7474 ; ; Single arg
7575 (is (= -3 (- 3 )))
Original file line number Diff line number Diff line change 7878 ratio? -1/3 -3 -4/3
7979 ratio? -7/2 -37/2 -15 ]))
8080
81- (is (thrown? Exception (mod 10 0 )))
82- (is (thrown? Exception (mod ##Inf 1 ))) ; surprising since (/ ##Inf 1) = ##Inf
81+ (is (thrown? #?( :cljs :default :default Exception) (mod 10 0 )))
82+ (is (thrown? #?( :cljs :default :default Exception) (mod ##Inf 1 ))) ; surprising since (/ ##Inf 1) = ##Inf
8383 (is (NaN? (mod 1 ##Inf )))
84- (is (thrown? Exception (mod ##-Inf 1 ))) ; surprising since (/ ##-Inf 1) = ##-Inf
84+ (is (thrown? #?( :cljs :default :default Exception) (mod ##-Inf 1 ))) ; surprising since (/ ##-Inf 1) = ##-Inf
8585 (is (NaN? (mod 1 ##-Inf )))
86- (is (thrown? Exception (mod ##NaN 1 )))
87- (is (thrown? Exception (mod 1 ##NaN )))
88- (is (thrown? Exception (mod ##NaN 1 )))))
86+ (is (thrown? #?( :cljs :default :default Exception) (mod ##NaN 1 )))
87+ (is (thrown? #?( :cljs :default :default Exception) (mod 1 ##NaN )))
88+ (is (thrown? #?( :cljs :default :default Exception) (mod ##NaN 1 )))))
Original file line number Diff line number Diff line change 1313 " abc*+!-_'?<>=" :abc/abc*+!-_'?<>=
1414 " abc*+!-_'?<>=" 'abc/abc*+!-_'?<>=)
1515
16- (is (thrown? Exception (name nil )))))
16+ (is (thrown? #?( :cljs :default :default Exception) (name nil )))))
Original file line number Diff line number Diff line change 1111 nil :abc
1212 nil 'abc)
1313
14- (is (thrown? Exception (namespace nil )))))
14+ (is (thrown? #?( :cljs :default :default Exception) (namespace nil )))))
Original file line number Diff line number Diff line change 44
55(when-var-exists clojure.core/NaN?
66 (deftest test-NaN?
7- (is (thrown? Exception (NaN? nil )))
8- (is (thrown? Exception (NaN? " ##NaN" )))
7+ (is (thrown? #?( :cljs :default :default Exception) (NaN? nil )))
8+ (is (thrown? #?( :cljs :default :default Exception) (NaN? " ##NaN" )))
99 (is (double? ##NaN ))
1010 ; ; NaN is not equal to anything, even itself.
1111 ; ; See: https://clojure.org/guides/equality
Original file line number Diff line number Diff line change 1010 (is (= 2 (numerator 2/3 )))
1111 (is (= 3 (numerator 3/4 )))])
1212
13- (is (thrown? Exception (numerator 1 )))
14- (is (thrown? Exception (numerator 1.0 )))
15- (is (thrown? Exception (numerator 1N )))
16- (is (thrown? Exception (numerator 1.0M )))
17- (is (thrown? Exception (numerator ##Inf )))
18- (is (thrown? Exception (numerator ##NaN )))
19- (is (thrown? Exception (numerator nil )))))
13+ (is (thrown? #?( :cljs :default :default Exception) (numerator 1 )))
14+ (is (thrown? #?( :cljs :default :default Exception) (numerator 1.0 )))
15+ (is (thrown? #?( :cljs :default :default Exception) (numerator 1N )))
16+ (is (thrown? #?( :cljs :default :default Exception) (numerator 1.0M )))
17+ (is (thrown? #?( :cljs :default :default Exception) (numerator ##Inf )))
18+ (is (thrown? #?( :cljs :default :default Exception) (numerator ##NaN )))
19+ (is (thrown? #?( :cljs :default :default Exception) (numerator nil )))))
You can’t perform that action at this time.
0 commit comments