(make-list): New tests.
authorKevin Ryde <user42@zip.com.au>
Sat, 23 Apr 2005 00:04:57 +0000 (00:04 +0000)
committerKevin Ryde <user42@zip.com.au>
Sat, 23 Apr 2005 00:04:57 +0000 (00:04 +0000)
test-suite/tests/list.test

index 06ef0a0..64b7c93 100644 (file)
           (y (apply list x)))
       (not (eq? x y)))))
 
+;;; make-list
+
+(with-test-prefix "make-list"
+
+  (pass-if "documented?"
+    (documented? make-list))
+
+  (with-test-prefix "no init"
+    (pass-if "0"
+      (equal? '() (make-list 0)))
+    (pass-if "1"
+      (equal? '(()) (make-list 1)))
+    (pass-if "2"
+      (equal? '(() ()) (make-list 2)))
+    (pass-if "3"
+      (equal? '(() () ()) (make-list 3))))
+
+  (with-test-prefix "with init"
+    (pass-if "0"
+      (equal? '() (make-list 0 'foo)))
+    (pass-if "1"
+      (equal? '(foo) (make-list 1 'foo)))
+    (pass-if "2"
+      (equal? '(foo foo) (make-list 2 'foo)))
+    (pass-if "3"
+      (equal? '(foo foo foo) (make-list 3 'foo)))))
+
 ;;; cons*
 
 (with-test-prefix "cons*"