|
14 | 14 | (deftest fn-error-checking
|
15 | 15 | (testing "bad arglist"
|
16 | 16 | (is (fails-with-cause? java.lang.IllegalArgumentException
|
17 |
| - #"Parameter declaration a should be a vector" |
| 17 | + #"Call to clojure.core/fn did not conform to spec" |
18 | 18 | (eval '(fn "a" a)))))
|
19 | 19 |
|
20 | 20 | (testing "treat first param as args"
|
21 | 21 | (is (fails-with-cause? java.lang.IllegalArgumentException
|
22 |
| - #"Parameter declaration a should be a vector" |
| 22 | + #"Call to clojure.core/fn did not conform to spec" |
23 | 23 | (eval '(fn "a" [])))))
|
24 | 24 |
|
25 | 25 | (testing "looks like listy signature, but malformed declaration"
|
26 | 26 | (is (fails-with-cause? java.lang.IllegalArgumentException
|
27 |
| - #"Parameter declaration 1 should be a vector" |
| 27 | + #"Call to clojure.core/fn did not conform to spec" |
28 | 28 | (eval '(fn (1))))))
|
29 | 29 |
|
30 | 30 | (testing "checks each signature"
|
31 | 31 | (is (fails-with-cause? java.lang.IllegalArgumentException
|
32 |
| - #"Parameter declaration a should be a vector" |
| 32 | + #"Call to clojure.core/fn did not conform to spec" |
33 | 33 | (eval '(fn
|
34 | 34 | ([a] 1)
|
35 | 35 | ("a" 2))))))
|
36 | 36 |
|
37 | 37 | (testing "correct name but invalid args"
|
38 | 38 | (is (fails-with-cause? java.lang.IllegalArgumentException
|
39 |
| - #"Parameter declaration a should be a vector" |
| 39 | + #"Call to clojure.core/fn did not conform to spec" |
40 | 40 | (eval '(fn a "a")))))
|
41 | 41 |
|
42 | 42 | (testing "first sig looks multiarity, rest of sigs should be lists"
|
43 | 43 | (is (fails-with-cause? java.lang.IllegalArgumentException
|
44 |
| - #"Invalid signature \[a b\] should be a list" |
| 44 | + #"Call to clojure.core/fn did not conform to spec" |
45 | 45 | (eval '(fn a
|
46 | 46 | ([a] 1)
|
47 | 47 | [a b])))))
|
48 | 48 |
|
49 | 49 | (testing "missing parameter declaration"
|
50 | 50 | (is (fails-with-cause? java.lang.IllegalArgumentException
|
51 |
| - #"Parameter declaration missing" |
| 51 | + #"Call to clojure.core/fn did not conform to spec" |
52 | 52 | (eval '(fn a))))
|
53 | 53 | (is (fails-with-cause? java.lang.IllegalArgumentException
|
54 |
| - #"Parameter declaration missing" |
| 54 | + #"Call to clojure.core/fn did not conform to spec" |
55 | 55 | (eval '(fn))))))
|
0 commit comments