Test to ensure exception handling in yield-from works right
This commit is contained in:
parent
86d8f69ef7
commit
917ba9fce5
@ -241,5 +241,21 @@
|
|||||||
(yield-from [1 2 3]))
|
(yield-from [1 2 3]))
|
||||||
(assert (= (list (yield-from-test)) [0 1 2 1 2 3])))
|
(assert (= (list (yield-from-test)) [0 1 2 1 2 3])))
|
||||||
|
|
||||||
|
(defn test-yield-from-exception-handling []
|
||||||
|
"NATIVE: Ensure exception handling in yield from works right"
|
||||||
|
(defn yield-from-subgenerator-test []
|
||||||
|
(yield 1)
|
||||||
|
(yield 2)
|
||||||
|
(yield 3)
|
||||||
|
(assert 0))
|
||||||
|
(defn yield-from-test []
|
||||||
|
(for* [i (range 3)]
|
||||||
|
(yield i))
|
||||||
|
(try
|
||||||
|
(yield-from (yield-from-subgenerator-test))
|
||||||
|
(catch [e AssertionError]
|
||||||
|
(yield 4))))
|
||||||
|
(assert (= (list (yield-from-test)) [0 1 2 1 2 3 4])))
|
||||||
|
|
||||||
(defn test-botsbuildbots []
|
(defn test-botsbuildbots []
|
||||||
(assert (> (len (first (Botsbuildbots))) 50)))
|
(assert (> (len (first (Botsbuildbots))) 50)))
|
||||||
|
Loading…
Reference in New Issue
Block a user