Working on single assert.
This commit is contained in:
parent
80e8a1c8c5
commit
98ccabf9b4
2 changed files with 29 additions and 0 deletions
7
test.nim
7
test.nim
|
|
@ -3,6 +3,7 @@ import einheit
|
|||
testSuite UnitTests:
|
||||
var
|
||||
testObj: int
|
||||
testArray: array[4, int]
|
||||
|
||||
proc doThings()=
|
||||
# This proc won't be invoked as a test
|
||||
|
|
@ -11,6 +12,8 @@ testSuite UnitTests:
|
|||
|
||||
method setup()=
|
||||
self.testObj = 90
|
||||
for i in 0 ..< self.testArray.len():
|
||||
self.testArray[i] = i
|
||||
|
||||
method tearDown()=
|
||||
self.testObj = 0
|
||||
|
|
@ -20,6 +23,9 @@ testSuite UnitTests:
|
|||
self.doThings()
|
||||
self.assertTrue(4 == 4)
|
||||
|
||||
method testArrayAssert()=
|
||||
self.assertTrue(self.testArray == [0,1,2])
|
||||
|
||||
method testForC()=
|
||||
var c = 0
|
||||
# supposed to fail
|
||||
|
|
@ -44,6 +50,7 @@ testSuite UnitTestsNew:
|
|||
|
||||
method testMore()=
|
||||
self.assertEqual("String", "String")
|
||||
self.assert 0 == 1
|
||||
|
||||
method testMoreMore()=
|
||||
self.assertFalse("String" != "String")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue