made some tests green

This commit is contained in:
Araq 2012-09-12 08:43:24 +02:00
commit 8178cd4fab
21 changed files with 42 additions and 39 deletions

View file

@ -1,7 +1,8 @@
template withOpenFile(f: expr, filename: string, mode: TFileMode,
actions: stmt): stmt =
actions: stmt): stmt {.immediate.} =
block:
# test that 'f' is implicitely 'injecting':
var f: TFile
if open(f, filename, mode):
try:
@ -15,11 +16,11 @@ withOpenFile(txt, "ttempl3.txt", fmWrite):
writeln(txt, "line 1")
txt.writeln("line 2")
# Test zero argument template:
template ha: expr = myVar[0]
var
myVar: array[0..1, int]
# Test zero argument template:
template ha: expr = myVar[0]
ha = 1
echo(ha)
@ -32,7 +33,7 @@ var `hu "XYZ"` = "yay"
echo prefix(XYZ)
template typedef(name: expr, typ: typeDesc) {.immediate.} =
template typedef(name: expr, typ: typeDesc) {.immediate, dirty.} =
type
`T name`* = typ
`P name`* = ref `T name`