some tests cleaned up; some bugfixes

This commit is contained in:
Araq 2011-04-11 00:25:24 +02:00
commit fc6cc79273
18 changed files with 106 additions and 69 deletions

View file

@ -1,13 +0,0 @@
discard """
file: "tambsym2.nim"
line: 9
errormsg: "undeclared identifier: \'CreateRGBSurface\'"
"""
from sdl import PSurface
discard SDL.CreateRGBSurface(SDL.SWSURFACE, 23, 34,
32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xff000000'i32)

View file

@ -1,12 +1,12 @@
discard """
file: "tbind4.nim"
line: 9
file: "mbind4.nim"
line: 6
errormsg: "undeclared identifier: \'lastId\'"
"""
# Module B
import mbind4
echo genId() #ERROR_MSG instantiation from here
echo genId()

View file

@ -1,7 +1,7 @@
discard """
file: "tnamedparams.nim"
line: 8
errormsg: "Error: type mismatch: got (input: string, filename: string, line: int, col: int)"
errormsg: "type mismatch: got (input: string, filename: string, line: int, col: int)"
"""
import pegs

View file

@ -1,6 +1,6 @@
discard """
line: 6
errormsg: "Error: type mismatch: got (int) but expected 'bool'"
errormsg: "type mismatch: got (int) but expected 'bool'"
"""
if 1:

View file

@ -1,6 +1,6 @@
discard """
file: "tnot.nim"
line: 14
file: "system.nim"
line: 599
errormsg: "type mismatch"
"""
# BUG: following compiles, but should not:

View file

@ -1,13 +1,13 @@
discard """
file: "toverl.nim"
line: 11
errormsg: "attempt to redefine \'TNone\'"
errormsg: "redefinition of \'TNone\'"
"""
# Test for overloading
type
TNone {.exportc: "_NONE", final.} = object
proc TNone(a, b: int) = nil #ERROR_MSG attempt to redefine 'TNone'
# Test for overloading
type
TNone {.exportc: "_NONE", final.} = object
proc TNone(a, b: int) = nil #ERROR_MSG attempt to redefine 'TNone'

View file

@ -1,6 +1,6 @@
discard """
file: "trecinca.nim"
line: 8
file: "trecincb.nim"
line: 9
errormsg: "recursive dependency: \'tests/reject/trecincb.nim\'"
"""
# Test recursive includes

View file

@ -3,21 +3,21 @@ discard """
line: 25
errormsg: "internal error: cannot generate C type for: PA"
"""
# Test recursive type descriptions
# (mainly for the C code generator)
type
PA = ref TA
TA = array [0..2, PA]
PRec = ref TRec
TRec {.final.} = object
a, b: TA
P1 = ref T1
PB = ref TB
TB = array [0..3, P1]
T1 = array [0..6, PB]
# Test recursive type descriptions
# (mainly for the C code generator)
type
PA = ref TA
TA = array [0..2, PA]
PRec = ref TRec
TRec {.final.} = object
a, b: TA
P1 = ref T1
PB = ref TB
TB = array [0..3, P1]
T1 = array [0..6, PB]
var
x: PA

View file

@ -1,7 +1,7 @@
discard """
file: "ttypelessemptyset.nim"
line: 5
errormsg: "Error: internal error: invalid kind for last(tyEmpty)"
errormsg: "internal error: invalid kind for last(tyEmpty)"
"""
var q = false
discard (if q: {} else: {})

View file

@ -1,6 +1,6 @@
discard """
file: "ttypenoval.nim"
line: 36
line: 38
errormsg: "a type has no value"
"""