1
1
mirror of https://github.com/kanaka/mal.git synced 2024-08-16 17:20:23 +03:00

tests: step8: Verify nth doesn't throw on nil elements

This commit is contained in:
Dov Murik 2019-10-31 01:06:46 +02:00
parent 5884a5ba0b
commit 0fa01f40a9

View File

@ -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