1
0
mirror of https://github.com/janet-lang/janet synced 2025-12-01 14:28:05 +00:00

Fix error behavior when calling functions with incorrect arities.

This commit is contained in:
Calvin Rose
2018-12-30 18:41:44 -05:00
parent 8dde89126e
commit 6b4824c2ab
3 changed files with 24 additions and 18 deletions

View File

@@ -70,4 +70,8 @@
(= (get res 3) 4)
(= (get res 5) 6)) "loop :pairs")
# Another regression test - no segfaults
(defn afn [x] x)
(assert (= 1 (try (afn) ([err] 1))) "calling function with wrong arity does not segfault.")
(end-suite)