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:
parent
5884a5ba0b
commit
0fa01f40a9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user