whileLet
This commit is contained in:
@@ -628,4 +628,12 @@
|
||||
(assert (contains intersection3d "cy1"))
|
||||
(assert (contains intersection3d "cy3"))
|
||||
)
|
||||
(Assert.pass))
|
||||
(Assert.pass))
|
||||
|
||||
(function _testWhileLet []
|
||||
(let [&mut idx 0
|
||||
lines ["a" "b" "c"]
|
||||
stream (Stream.fromString "a\nb\nc")]
|
||||
(whileLet [(Some line) (stream.takeLine)]
|
||||
(Assert.equals (nth lines idx) line)
|
||||
(+= idx 1))))
|
Reference in New Issue
Block a user