summary refs log tree commit diff stats
path: root/tests/destructor/twidgets.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/destructor/twidgets.nim')
-rw-r--r--tests/destructor/twidgets.nim12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/destructor/twidgets.nim b/tests/destructor/twidgets.nim
index 64fe8ab96..f13868110 100644
--- a/tests/destructor/twidgets.nim
+++ b/tests/destructor/twidgets.nim
@@ -1,11 +1,10 @@
 discard """
-  cmd: '''nim c --newruntime $file'''
+  cmd: '''nim c -d:nimAllocStats --newruntime $file'''
   output: '''button
 clicked!
-1 1  alloc/dealloc pairs: 0'''
+(allocCount: 4, deallocCount: 4)'''
 """
 
-import core / allocators
 import system / ansi_c
 
 type
@@ -63,7 +62,7 @@ proc main =
   var b = newButton("button", nil)
   let u: Button = b
   b.onclick = proc () =
-    b.caption = "clicked!"
+    u.caption = "clicked!"
   w.add b
 
   w.draw()
@@ -72,7 +71,6 @@ proc main =
 
   w.draw()
 
-main()
+dumpAllocstats:
+  main()
 
-let (a, d) = allocCounters()
-discard cprintf("%ld %ld  alloc/dealloc pairs: %ld\n", a, d, allocs)