new tester; all tests categorized

This commit is contained in:
Araq 2014-01-13 02:10:03 +01:00
commit 20b5f31c03
481 changed files with 794 additions and 2506 deletions

7
tests/module/mopaque.nim Normal file
View file

@ -0,0 +1,7 @@
type
TLexer* {.final.} = object
line*: int
filename*: string
buffer: cstring
proc noProcVar*(): int = 18

1
tests/module/mrecmod.nim Normal file
View file

@ -0,0 +1 @@
import trecmod

View file

@ -0,0 +1,9 @@
# Module B
import trecmod2
proc p*(x: trecmod2.T1): trecmod2.T1 =
# this works because the compiler has already
# added T1 to trecmod2's interface symbol table
return x + 1

18
tests/module/topaque.nim Normal file
View file

@ -0,0 +1,18 @@
discard """
file: "topaque.nim"
line: 16
errormsg: "undeclared identifier: \'buffer\'"
"""
# Test the new opaque types
import
mopaque
var
L: TLexer
L.filename = "ha"
L.line = 34
L.buffer[0] = '\0' #ERROR_MSG undeclared field: 'buffer'

12
tests/module/trecinca.nim Normal file
View file

@ -0,0 +1,12 @@
discard """
file: "tests/reject/trecincb.nim"
line: 9
errormsg: "recursive dependency: 'tests/reject/trecincb.nim'"
"""
# Test recursive includes
include trecincb #ERROR_MSG recursive dependency: 'tests/trecincb.nim'
echo "trecina"

13
tests/module/trecincb.nim Normal file
View file

@ -0,0 +1,13 @@
discard """
file: "trecincb.nim"
line: 9
errormsg: "recursive dependency: 'tests/reject/trecincb.nim'"
"""
# Test recursive includes
include trecincb #ERROR_MSG recursive dependency: 'tests/trecincb.nim'
echo "trecinb"

2
tests/module/trecmod.nim Normal file
View file

@ -0,0 +1,2 @@
# recursive module
import mrecmod

10
tests/module/trecmod2.nim Normal file
View file

@ -0,0 +1,10 @@
type
T1* = int # Module A exports the type ``T1``
import mrecmod2 # the compiler starts parsing B
proc main() =
var i = p(3) # works because B has been parsed completely here
main()