Reenable a few tests
This commit is contained in:
parent
ddfb7d9877
commit
f2b041f168
4 changed files with 7 additions and 10 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
discard """
|
discard """
|
||||||
output: "Key: 12 value: 12Key: 13 value: 13 Key: A value: 12 Key: B value: 13"
|
output: "Key: 12 value: 12Key: 13 value: 13 Key: A value: 12 Key: B value: 13"
|
||||||
disabled: true
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# test explicit type instantiation
|
# test explicit type instantiation
|
||||||
|
|
@ -14,12 +13,12 @@ proc newDict*[TKey, TValue](): PDict[TKey, TValue] =
|
||||||
new(result)
|
new(result)
|
||||||
result.data = @[]
|
result.data = @[]
|
||||||
|
|
||||||
proc add*(d: PDict, k: TKey, v: TValue) =
|
proc add*(d: PDict, k: d.TKey, v: d.TValue) =
|
||||||
d.data.add((k, v))
|
d.data.add((k, v))
|
||||||
|
|
||||||
|
|
||||||
#iterator items*(d: PDict): tuple[k: TKey, v: TValue] =
|
iterator items*(d: PDict): tuple[k: d.TKey, v: d.TValue] =
|
||||||
# for k, v in items(d.data): yield (k, v)
|
for k, v in items(d.data): yield (k, v)
|
||||||
|
|
||||||
var d = newDict[int, string]()
|
var d = newDict[int, string]()
|
||||||
d.add(12, "12")
|
d.add(12, "12")
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
discard """
|
discard """
|
||||||
disabled: true
|
output: "10"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# {. noforward: on .}
|
# {. noforward: on .}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
discard """
|
discard """
|
||||||
errormsg: "usage of 'disallowIf' is a user-defined error"
|
errormsg: "usage of 'disallowIf' is an {.error.} defined at tdisallowif.nim(10, 1)"
|
||||||
line: 24
|
line: 24
|
||||||
disabled: true
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
template optZero{x+x}(x: int): int = x*3
|
template optZero{x+x}(x: int): int = x*3
|
||||||
|
|
@ -11,7 +10,7 @@ template optSubstr1{x = substr(x, 0, b)}(x: string, b: int) = setlen(x, b+1)
|
||||||
template disallowIf{
|
template disallowIf{
|
||||||
if cond: action
|
if cond: action
|
||||||
else: action2
|
else: action2
|
||||||
}(cond: bool, action, action2: stmt) {.error.} = action
|
}(cond: bool, action, action2: typed) {.error.} = action
|
||||||
|
|
||||||
var y = 12
|
var y = 12
|
||||||
echo y+y
|
echo y+y
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
discard """
|
discard """
|
||||||
errormsg: "value expected, but got a type"
|
errormsg: "invalid type: 'type seq[tuple[title: string, body: string]]' for var"
|
||||||
line: 7
|
line: 7
|
||||||
disabled: true
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
proc crashAndBurn() =
|
proc crashAndBurn() =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue