new tester; all tests categorized
This commit is contained in:
parent
51ee524109
commit
20b5f31c03
481 changed files with 794 additions and 2506 deletions
15
tests/object/tobject.nim
Normal file
15
tests/object/tobject.nim
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import unittest
|
||||
|
||||
type Obj = object
|
||||
foo: int
|
||||
|
||||
proc makeObj(x: int): Obj =
|
||||
result.foo = x
|
||||
|
||||
suite "object basic methods":
|
||||
test "it should convert an object to a string":
|
||||
var obj = makeObj(1)
|
||||
# Should be "obj: (foo: 1)" or similar.
|
||||
check($obj == "(foo: 1)")
|
||||
test "it should test equality based on fields":
|
||||
check(makeObj(1) == makeObj(1))
|
||||
Loading…
Add table
Add a link
Reference in a new issue