new tester; all tests categorized
This commit is contained in:
parent
51ee524109
commit
20b5f31c03
481 changed files with 794 additions and 2506 deletions
8
tests/modules/mexporta.nim
Normal file
8
tests/modules/mexporta.nim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# module A
|
||||
import mexportb
|
||||
export mexportb.TMyObject, mexportb.xyz
|
||||
|
||||
export mexportb.q
|
||||
|
||||
proc `$`*(x: TMyObject): string = "my object"
|
||||
|
||||
7
tests/modules/mexportb.nim
Normal file
7
tests/modules/mexportb.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# module B
|
||||
type TMyObject* = object
|
||||
|
||||
const xyz* = 13
|
||||
|
||||
proc q*(x: int): int = 6
|
||||
proc q*(x: string): string = "8"
|
||||
10
tests/modules/texport.nim
Normal file
10
tests/modules/texport.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
discard """
|
||||
output: "my object68"
|
||||
"""
|
||||
|
||||
import mexporta
|
||||
|
||||
# B.TMyObject has been imported implicitly here:
|
||||
var x: TMyObject
|
||||
echo($x, q(0), q"0")
|
||||
|
||||
10
tests/modules/timportexcept.nim
Normal file
10
tests/modules/timportexcept.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
discard """
|
||||
line: 9
|
||||
errormsg: "undeclared identifier: '%'"
|
||||
"""
|
||||
|
||||
import strutils except `%`
|
||||
|
||||
# doesn't work
|
||||
echo "$1" % "abc"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue