diff options
author | Danil Yarantsev <tiberiumk12@gmail.com> | 2020-07-25 21:35:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-25 20:35:20 +0200 |
commit | 080bed8b6b478699f740b61915f9e06ab30554d6 (patch) | |
tree | b55d77979f8ffd184287828210e282628b475ba5 /tests/arc | |
parent | 2aca748ddd59a9fc428c717d5a6b86044613cdc6 (diff) | |
download | Nim-080bed8b6b478699f740b61915f9e06ab30554d6.tar.gz |
Add a test-case for #12990 (#15072)
* closes #12990 * Add a test-case for #12990
Diffstat (limited to 'tests/arc')
-rw-r--r-- | tests/arc/amodule.nim | 13 | ||||
-rw-r--r-- | tests/arc/tamodule.nim | 5 |
2 files changed, 16 insertions, 2 deletions
diff --git a/tests/arc/amodule.nim b/tests/arc/amodule.nim index e853d0a77..2b4204a66 100644 --- a/tests/arc/amodule.nim +++ b/tests/arc/amodule.nim @@ -1,3 +1,4 @@ +# bug #14219 var vectors = @["a", "b", "c", "d", "e"] iterator testVectors(): string = @@ -7,4 +8,14 @@ iterator testVectors(): string = var r = "" for item in testVectors(): r.add item -echo r \ No newline at end of file +echo r + +# bug #12990 +iterator test(): int {.closure.} = + yield 0 + +let x = test +while true: + let val = x() + if finished(x): break + echo val diff --git a/tests/arc/tamodule.nim b/tests/arc/tamodule.nim index ac9757bd7..1412e0a7c 100644 --- a/tests/arc/tamodule.nim +++ b/tests/arc/tamodule.nim @@ -1,5 +1,8 @@ discard """ - output: "abcde" + output: ''' +abcde +0 +''' cmd: "nim c --gc:arc $file" """ |