diff options
author | Andy Wingo <wingo@pobox.com> | 2013-05-16 23:35:35 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-05-17 22:24:05 +0200 |
commit | 2bb1ab70e29c7d74b596cc7c36d622de681f996c (patch) | |
tree | 69de5c9d00a40a76aa8dc4e0d3e9a4096a0001cd | |
parent | 23e20c4ef6ad2bc0214f6d0c473256f741c4f399 (diff) | |
download | guile-2bb1ab70e29c7d74b596cc7c36d622de681f996c.tar.gz |
add rtl arity tests
* test-suite/tests/rtl.test ("simply procedure arity"): Add tests that
arities make it all the way to cold ELF and back to warm Guile.
-rw-r--r-- | test-suite/tests/rtl.test | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test-suite/tests/rtl.test b/test-suite/tests/rtl.test index d9c701892..c718a379b 100644 --- a/test-suite/tests/rtl.test +++ b/test-suite/tests/rtl.test @@ -294,3 +294,33 @@ (return 0) (end-arity) (end-program)))))) + +(with-test-prefix "simply procedure arity" + (pass-if-equal "#<procedure foo ()>" + (object->string + (assemble-program + '((begin-program foo ((name . foo))) + (begin-standard-arity () 1 #f) + (load-constant 0 42) + (return 0) + (end-arity) + (end-program))))) + (pass-if-equal "#<procedure foo (x y)>" + (object->string + (assemble-program + '((begin-program foo ((name . foo))) + (begin-standard-arity (x y) 2 #f) + (load-constant 0 42) + (return 0) + (end-arity) + (end-program))))) + + (pass-if-equal "#<procedure foo (x #:optional y . z)>" + (object->string + (assemble-program + '((begin-program foo ((name . foo))) + (begin-opt-arity (x) (y) z 3 #f) + (load-constant 0 42) + (return 0) + (end-arity) + (end-program)))))) |