From 79025a7087ab690946339ea58ef8cb1f19e5de57 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sat, 23 Feb 2019 03:16:30 +0000 Subject: [PATCH] Test append on dotted lists. I broked it. --- tests/runtime/test-list.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/runtime/test-list.scm b/tests/runtime/test-list.scm index 8fe5c174d..22120405b 100644 --- a/tests/runtime/test-list.scm +++ b/tests/runtime/test-list.scm @@ -36,6 +36,22 @@ USA. (let ((n-bytes (- stack-end stack-start))) (quotient n-bytes bytes-per-word))))) +(define-test 'append-dotted + (lambda () + (assert-equal (append 'x) 'x) + (assert-equal (append '(x) 'y) '(x . y)) + (expect-error + (lambda () + (assert-equal (append '(x) '(y) 'z) '(x y . z)))))) + +(define-test 'append!-dotted + (lambda () + (assert-equal (append! 'x) 'x) + (assert-equal (append! (list 'x) 'y) '(x . y)) + (expect-error + (lambda () + (assert-equal (append! (list 'x) (list 'y) 'z) '(x y . z)))))) + (define-test 'map-long (lambda () (let* ((n (words-in-stack)) -- 2.25.1