diff options
author | Leah Neukirchen <leah@vuxu.org> | 2023-01-02 19:10:02 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2023-01-02 19:10:02 +0100 |
commit | 5e79d95159a6cd680d045314fe427b263e7ab344 (patch) | |
tree | b70a26a8bc1721ec08c270db5f1d8a704dfa6bc3 /tests | |
parent | 909cf1ba9001f52afbbb6f7cfb6c919869c068ac (diff) | |
download | mew-5e79d95159a6cd680d045314fe427b263e7ab344.tar.gz mew-5e79d95159a6cd680d045314fe427b263e7ab344.tar.xz mew-5e79d95159a6cd680d045314fe427b263e7ab344.zip |
add push!, pop!
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test.mew | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test.mew b/tests/test.mew index 44fdb95..d2eacbd 100644 --- a/tests/test.mew +++ b/tests/test.mew @@ -114,6 +114,14 @@ (test 5 (loc (x 6) (dec! x))) (test 5 (loc (x 7) (dec! x 2)))) +(test-group "push!" + (test '(3 2 1) (loc (l '()) (push! l 1) (push! l 2) (push! l 3) l))) + +(test-group "pop!" + (test 1 (loc (l '(3 2 1)) (pop! l) (pop! l) (pop! l))) + (test-error (loc (l '(2 1)) (pop! l) (pop! l) (pop! l))) + (test 'foo (loc (l '(2 1)) (pop! l) (pop! l) (pop! l 'foo)))) + (test-group "boolean" (test #f (boolean #f)) (test #t (boolean #t)) |