Test to ensure exception handling in yield-from works right

This commit is contained in:
Christopher Allan Webber 2014-11-20 20:40:22 -06:00
parent 86d8f69ef7
commit 917ba9fce5
1 changed files with 16 additions and 0 deletions

View File

@ -241,5 +241,21 @@
(yield-from [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 []
(assert (> (len (first (Botsbuildbots))) 50)))