summary refs log tree commit diff stats
path: root/examples/tunit.nim
diff options
context:
space:
mode:
Diffstat (limited to 'examples/tunit.nim')
-rw-r--r--examples/tunit.nim47
1 files changed, 0 insertions, 47 deletions
diff --git a/examples/tunit.nim b/examples/tunit.nim
deleted file mode 100644
index e8ff8a952..000000000
--- a/examples/tunit.nim
+++ /dev/null
@@ -1,47 +0,0 @@
-
-import
-  unittest, macros
-
-var
-    a = 1
-    b = 22
-    c = 1
-    d = 3
-
-suite "my suite":
-  setup:
-    echo "suite setup"
-    var testVar = "from setup"
-
-  teardown:
-    echo "suite teardown"
-
-  test "first suite test":
-    testVar = "modified"
-    echo "test var: " & testVar
-    check a > b
-
-  test "second suite test":
-    echo "test var: " & testVar
-
-proc foo: bool =
-  echo "running foo"
-  return true
-
-proc err =
-  raise newException(ArithmeticDefect, "some exception")
-
-test "final test":
-  echo "inside suite-less test"
-
-  check:
-    a == c
-    foo()
-    d > 10
-
-test "arithmetic failure":
-  expect(ArithmeticDefect):
-    err()
-
-  expect(ArithmeticDefect, CatchableError):
-    discard foo()