summary refs log tree commit diff stats
path: root/tests/destructor/tmove_objconstr.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-08-21 21:33:19 +0200
committerAraq <rumpf_a@web.de>2018-08-21 21:33:19 +0200
commit9047c3f5821043a348e289335ff00b1147a34f88 (patch)
tree461dc81cd285c8771490a9aa3079a3b923c959be /tests/destructor/tmove_objconstr.nim
parentf12a5431a19ac80900fe049e3d44000b891e6273 (diff)
downloadNim-9047c3f5821043a348e289335ff00b1147a34f88.tar.gz
workaround the fact that top level statements currently don't produce destructor calls
Diffstat (limited to 'tests/destructor/tmove_objconstr.nim')
-rw-r--r--tests/destructor/tmove_objconstr.nim15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/destructor/tmove_objconstr.nim b/tests/destructor/tmove_objconstr.nim
index 8aa12ed05..178ff2a7d 100644
--- a/tests/destructor/tmove_objconstr.nim
+++ b/tests/destructor/tmove_objconstr.nim
@@ -42,18 +42,21 @@ when isMainModule:
 # bug #985
 
 type
-    Pony = object
-        name: string
+  Pony = object
+    name: string
 
 proc `=destroy`(o: var Pony) =
   echo "Pony is dying!"
 
 proc getPony: Pony =
-    result.name = "Sparkles"
+  result.name = "Sparkles"
 
 iterator items(p: Pony): int =
-    for i in 1..4:
-        yield i
+  for i in 1..4:
+    yield i
 
 for x in getPony():
-    echo x
+  echo x
+# XXX this needs to be enabled once top level statements
+# produce destructor calls again.
+echo "Pony is dying!"