summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2023-01-02 19:31:49 +0100
committerLeah Neukirchen <leah@vuxu.org>2023-01-02 19:31:49 +0100
commite3ddf82f1ed8abbca9de770cfabda0fd03d95084 (patch)
treee0f062c5792b81e58b656bb89380c566361159b4 /tests
parent5e79d95159a6cd680d045314fe427b263e7ab344 (diff)
downloadmew-e3ddf82f1ed8abbca9de770cfabda0fd03d95084.tar.gz
mew-e3ddf82f1ed8abbca9de770cfabda0fd03d95084.tar.xz
mew-e3ddf82f1ed8abbca9de770cfabda0fd03d95084.zip
add repeat
Diffstat (limited to 'tests')
-rw-r--r--tests/test.mew11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test.mew b/tests/test.mew
index d2eacbd..96f0764 100644
--- a/tests/test.mew
+++ b/tests/test.mew
@@ -718,3 +718,14 @@
   (test 42 (imp #t #t #t 42))
   (test 42 (imp 39 40 41 42))
   (test #t (imp 39 #f 41 42)))
+
+(test-group "repeat"
+  (test '(1 2 3 1 2 3 1 2 3 1 2 3) (repeat '(1 2 3) 4))
+  (test #(1 2 3 1 2 3 1 2 3 1 2 3) (repeat #(1 2 3) 4))
+  (test "123123123123" (repeat "123" 4))
+  (test "xxxx" (repeat #\x 4))
+
+  (test '() (repeat '(1 2 3) 0))
+  (test #() (repeat #(1 2 3) 0))
+  (test "" (repeat "123" 0))
+  (test "" (repeat #\x 0)))