summary refs log tree commit diff stats
path: root/tests/align
Commit message (Expand)AuthorAgeFilesLines
* fixes #13122 (#13126)Andreas Rumpf2020-01-133-0/+63
thor Adam Strzelecki <ono@java.pl> 2015-09-04 23:05:22 +0200 committer Adam Strzelecki <ono@java.pl> 2015-09-04 23:05:22 +0200 examples: Trim .nim files trailing whitespace' href='/ahoang/Nim/commit/examples/tunit.nim?h=devel&id=5d80548cce84ea62dc8b85c10375f70d037ea4f8'>5d80548cc ^
0926754e6 ^
5d80548cc ^









0926754e6 ^
5d80548cc ^

32afc1a56 ^
5d80548cc ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
 





























                               
                                                       









                               
                          

         
                                          
                 
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(ArithmeticError, "some exception")

test "final test":
  echo "inside suite-less test"

  check:
    a == c
    foo()
    d > 10

test "arithmetic failure":
  expect(ArithmeticError):
    err()

  expect(ArithmeticError, CatchableError):
    discard foo()