summary refs log tree commit diff stats
path: root/tests/closure
diff options
context:
space:
mode:
authornarimiran <narimiran@disroot.org>2019-09-13 07:59:38 +0200
committernarimiran <narimiran@disroot.org>2019-09-13 07:59:38 +0200
commitee6df5bd247685d01d96c05878f85b053904d3fa (patch)
tree2d739150530d49aec96d74f3142b1f7338e932e0 /tests/closure
parentd79fb77974dbb42878b02d1f4904a837de1954f0 (diff)
downloadNim-ee6df5bd247685d01d96c05878f85b053904d3fa.tar.gz
close #7104 by writing a test
Diffstat (limited to 'tests/closure')
-rw-r--r--tests/closure/tclosure_issues.nim23
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/closure/tclosure_issues.nim b/tests/closure/tclosure_issues.nim
index d9416e554..4688834de 100644
--- a/tests/closure/tclosure_issues.nim
+++ b/tests/closure/tclosure_issues.nim
@@ -1,6 +1,10 @@
 discard """
   output: '''true
-(999, 0)'''
+(999, 0)
+ok 0
+ok 1
+ok 2
+'''
 """
 
 
@@ -60,4 +64,19 @@ proc foo(): proc =
   return proc(): (int, int) =
     return (a, 0)
 
-echo foo()()
\ No newline at end of file
+echo foo()()
+
+
+block tissue7104:
+  proc sp(cb: proc())=
+      cb()
+
+  sp:
+      var i = 0
+      echo "ok ", i
+      sp():
+          inc i
+          echo "ok ", i
+          sp do:
+              inc i
+              echo "ok ", i