Merge tests/return-from.lisp into tests/control.lisp
authorDavid Vázquez <davazp@gmail.com>
Wed, 1 May 2013 21:40:54 +0000 (22:40 +0100)
committerDavid Vázquez <davazp@gmail.com>
Wed, 1 May 2013 21:40:54 +0000 (22:40 +0100)
tests/control.lisp
tests/return-from.lisp [deleted file]

index 7fc4055..5e010e3 100644 (file)
 
 (test (foo-2 nil))
 
+
+(test (equal (flet ((foo () (return-from foo 42)))
+               (foo))
+             42))
+
+(test (equal (let ((out (list)))
+               (labels ((zfoo (n rf i)
+                          (if (> n 0)
+                              (progn
+                                (push (lambda () (return-from zfoo n)) rf)
+                                (push n out)
+                                (zfoo (1- n) rf i)
+                                (push (- n) out))
+                              (progn
+                                (push 999 out)
+                                (funcall (nth i (reverse rf)))
+                                (push -999 out)))))
+                 (let ((rf (list)))
+                   (zfoo 5 rf 3)
+                   out)))
+             '(-5 -4 -3 999 1 2 3 4 5)))
diff --git a/tests/return-from.lisp b/tests/return-from.lisp
deleted file mode 100644 (file)
index 0d423ff..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-(test (equal (flet ((foo () (return-from foo 42)))
-               (foo))
-             42))
-
-(test (equal (let ((out (list)))
-               (labels ((zfoo (n rf i)
-                          (if (> n 0)
-                              (progn
-                                (push (lambda () (return-from zfoo n)) rf)
-                                (push n out)
-                                (zfoo (1- n) rf i)
-                                (push (- n) out))
-                              (progn
-                                (push 999 out)
-                                (funcall (nth i (reverse rf)))
-                                (push -999 out)))))
-                 (let ((rf (list)))
-                   (zfoo 5 rf 3)
-                   out)))
-             '(-5 -4 -3 999 1 2 3 4 5)))