1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-04 15:56:17 +00:00

Add some more test cases for bad arities.

This commit is contained in:
Calvin Rose 2018-12-30 18:44:00 -05:00
parent 6b4824c2ab
commit 0d4ab7dee0

View File

@ -72,6 +72,10 @@
# Another regression test - no segfaults # Another regression test - no segfaults
(defn afn [x] x) (defn afn [x] x)
(assert (= 1 (try (afn) ([err] 1))) "calling function with wrong arity does not segfault.") (assert (= 1 (try (afn) ([err] 1))) "bad arity 1")
(assert (= 4 (try ((fn [x y] (+ x y)) 1) ([_] 4))) "bad arity 2")
(assert (= 1 (try (identity) ([err] 1))) "bad arity 3")
(assert (= 1 (try (map) ([err] 1))) "bad arity 4")
(assert (= 1 (try (not) ([err] 1))) "bad arity 5")
(end-suite) (end-suite)