tbintre2.nim 461 B

1234567891011121314151617181920212223242526272829303132
  1. discard """
  2. file: "tbintre2.nim"
  3. output: "helloworld99110223"
  4. """
  5. # Same test, but check module boundaries
  6. import tbintree
  7. var
  8. root: PBinaryTree[string]
  9. x = newNode("hello")
  10. add(root, x)
  11. add(root, "world")
  12. if find(root, "world"):
  13. for str in items(root):
  14. stdout.write(str)
  15. else:
  16. stdout.writeLine("BUG")
  17. var
  18. r2: PBinaryTree[int]
  19. add(r2, newNode(110))
  20. add(r2, 223)
  21. add(r2, 99)
  22. for y in items(r2):
  23. stdout.write(y)
  24. #OUT helloworld99110223