From 0fa01f40a9b757812113df1cce8d2a514cbed49e Mon Sep 17 00:00:00 2001 From: Dov Murik Date: Thu, 31 Oct 2019 01:06:46 +0200 Subject: [PATCH] tests: step8: Verify nth doesn't throw on nil elements --- tests/step8_macros.mal | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/step8_macros.mal b/tests/step8_macros.mal index aa1ca3e3..bbc35c1c 100644 --- a/tests/step8_macros.mal +++ b/tests/step8_macros.mal @@ -49,6 +49,8 @@ ;=>1 (nth (list 1 2) 1) ;=>2 +(nth (list 1 2 nil) 2) +;=>nil (def! x "x") (def! x (nth (list 1 2) 2)) x @@ -98,6 +100,8 @@ x ;=>1 (nth [1 2] 1) ;=>2 +(nth [1 2 nil] 2) +;=>nil (def! x "x") (def! x (nth [1 2] 2)) x