summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/generics/tbintre2.nim28
-rw-r--r--tests/generics/tbintree.nim16
2 files changed, 8 insertions, 36 deletions
diff --git a/tests/generics/tbintre2.nim b/tests/generics/tbintre2.nim
deleted file mode 100644
index dadc9a064..000000000
--- a/tests/generics/tbintre2.nim
+++ /dev/null
@@ -1,28 +0,0 @@
-discard """
-  output: "helloworld99110223"
-"""
-# Same test, but check module boundaries
-
-import tbintree
-
-var
-  root: PBinaryTree[string]
-  x = newNode("hello")
-add(root, x)
-add(root, "world")
-if find(root, "world"):
-  for str in items(root):
-    stdout.write(str)
-else:
-  stdout.writeLine("BUG")
-
-var
-  r2: PBinaryTree[int]
-add(r2, newNode(110))
-add(r2, 223)
-add(r2, 99)
-for y in items(r2):
-  stdout.write(y)
-
-#OUT helloworld99110223
-stdout.write "\n"
diff --git a/tests/generics/tbintree.nim b/tests/generics/tbintree.nim
index 18af5b9af..a1a13c7b5 100644
--- a/tests/generics/tbintree.nim
+++ b/tests/generics/tbintree.nim
@@ -1,5 +1,9 @@
 discard """
-  output: "helloworld99110223"
+  output: '''hello
+world
+99
+110
+223'''
 """
 type
   TBinaryTree[T] = object      # TBinaryTree is a generic type with
@@ -89,9 +93,9 @@ when true:
   add(root, "world")
   if find(root, "world"):
     for str in items(root):
-      stdout.write(str)
+      echo(str)
   else:
-    stdout.writeLine("BUG")
+    echo("BUG")
 
   var
     r2: PBinaryTree[int]
@@ -99,8 +103,4 @@ when true:
   add(r2, 223)
   add(r2, 99)
   for y in items(r2):
-    stdout.write(y)
-
-  stdout.write "\n"
-
-#OUT helloworld99110223
+    echo(y)