require errormsg to be specified before file.

This commit is contained in:
Arne Döring 2018-11-29 16:07:51 +01:00 • committed by Araq
commit 1105d03644
264 changed files with 305 additions and 623 deletions

View file

@ -1,7 +1,7 @@
discard """
line: 7
errormsg: "has to be discarded"
line: 7
"""
proc myProc(name: string): string = "Hello " & name
myProc("Dominik")
myProc("Dominik")

View file

@ -1,6 +1,6 @@
discard """
line: 16
errormsg: "type mismatch"
line: 16
"""
type
@ -13,4 +13,4 @@ type
let dog: Dog = Dog(name: "Fluffy")
let cat: Cat = Cat(name: "Fluffy")
echo(dog == cat)
echo(dog == cat)

View file

@ -1,7 +1,7 @@
discard """
line: 6
errormsg: "type mismatch"
line: 6
"""
for i in 5:
echo i
echo i

View file

@ -1,6 +1,6 @@
discard """
line: 6
errormsg: "cannot infer the type of the sequence"
line: 6
"""
var list = @[]
var list = @[]

View file

@ -1,13 +1,13 @@
discard """
line: 27
errormsg: "has to be discarded"
line: 27
"""
# Page 35.
proc implicit: string =
"I will be returned"
proc discarded: string =
discard "I will not be returned"
@ -16,7 +16,7 @@ proc explicit: string =
proc resultVar: string =
result = "I will be returned"
proc resultVar2: string =
result = ""
result.add("I will be ")
@ -30,4 +30,4 @@ doAssert implicit() == "I will be returned"
doAssert discarded() == nil
doAssert explicit() == "I will be returned"
doAssert resultVar() == "I will be returned"
doAssert resultVar2() == "I will be returned"
doAssert resultVar2() == "I will be returned"