summary refs log tree commit diff stats
path: root/tests/arc/topt_refcursors.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/arc/topt_refcursors.nim')
-rw-r--r--tests/arc/topt_refcursors.nim43
1 files changed, 26 insertions, 17 deletions
diff --git a/tests/arc/topt_refcursors.nim b/tests/arc/topt_refcursors.nim
index f097150a3..8c638a4a1 100644
--- a/tests/arc/topt_refcursors.nim
+++ b/tests/arc/topt_refcursors.nim
@@ -1,26 +1,35 @@
 discard """
   output: ''''''
   cmd: '''nim c --gc:arc --expandArc:traverse --hint:Performance:off $file'''
-  nimout: '''--expandArc: traverse
+  nimout: '''
+--expandArc: traverse
 
 var
   it_cursor
-  jt_cursor
-it_cursor = root
-block :tmp:
-  while (
-    not (it_cursor == nil)):
-    echo [it_cursor.s]
-    it_cursor = it_cursor.ri
-jt_cursor = root
-block :tmp_1:
-  while (
-    not (jt_cursor == nil)):
-    var ri_1_cursor
-    ri_1_cursor = jt_cursor.ri
-    echo [jt_cursor.s]
-    jt_cursor = ri_1_cursor
--- end of expandArc ------------------------'''
+  jt
+try:
+  it_cursor = root
+  block :tmp:
+    while (
+      not (it_cursor == nil)):
+      echo [it_cursor.s]
+      it_cursor = it_cursor.ri
+  `=copy`(jt, root)
+  block :tmp_1:
+    while (
+      not (jt == nil)):
+      var ri_1
+      try:
+        `=copy`(ri_1, jt.ri)
+        echo [jt.s]
+        `=sink`(jt, ri_1)
+        `=wasMoved`(ri_1)
+      finally:
+        `=destroy`(ri_1)
+finally:
+  `=destroy`(jt)
+-- end of expandArc ------------------------
+'''
 """
 
 type