mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 12:07:51 +00:00
cleanup tests; don't use non-working 'msg' spec field
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
discard """
|
||||
file: "tissues.nim"
|
||||
output: '''
|
||||
20.0 USD
|
||||
Printable
|
||||
|
||||
@@ -3,7 +3,7 @@ output: '''10
|
||||
10
|
||||
|
||||
1'''
|
||||
msg: '''
|
||||
nimout: '''
|
||||
K=string V=int
|
||||
K=int64 V=string
|
||||
K=int V=int
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
discard """
|
||||
output: "0\n0\n0"
|
||||
msg: '''
|
||||
nimout: '''
|
||||
R=3 C=3 TE=9 FF=14 FC=20 T=int
|
||||
R=3 C=3 T=int
|
||||
'''
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
discard """
|
||||
output: "20\n10"
|
||||
msg: '''
|
||||
nimout: '''
|
||||
INFERRED int
|
||||
VALUE TYPE int
|
||||
VALUE TYPE NAME INT
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: "array[0..3, int]"
|
||||
nimout: "array[0..3, int]"
|
||||
"""
|
||||
|
||||
type
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: '''initApple
|
||||
nimout: '''initApple
|
||||
deinitApple
|
||||
Coral
|
||||
enum
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: '''nnkStmtList.newTree(
|
||||
nimout: '''nnkStmtList.newTree(
|
||||
nnkVarSection.newTree(
|
||||
nnkIdentDefs.newTree(
|
||||
newIdentNode("x"),
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
discard """
|
||||
msg: '''StmtList
|
||||
nimout: '''
|
||||
StmtList
|
||||
VarSection
|
||||
IdentDefs
|
||||
Ident !"x"
|
||||
Ident "x"
|
||||
Empty
|
||||
Call
|
||||
DotExpr
|
||||
Ident !"foo"
|
||||
Ident !"create"
|
||||
Ident "foo"
|
||||
Ident "create"
|
||||
IntLit 56'''
|
||||
"""
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: '''"muhaha"
|
||||
nimout: '''"muhaha"
|
||||
proc poo(x, y: int) =
|
||||
let y = x
|
||||
echo ["poo"]'''
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
discard """
|
||||
file: "tmacrogenerics.nim"
|
||||
msg: '''
|
||||
instantiation 1 with typedesc and typedesc
|
||||
counter: 1
|
||||
nimout: '''
|
||||
instantiation 1 with None and None
|
||||
instantiation 2 with None and None
|
||||
instantiation 3 with None and None
|
||||
counter: 3
|
||||
'''
|
||||
output: "int\nfloat\nint\nstring"
|
||||
"""
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
discard """
|
||||
msg: '''
|
||||
proc init(foo129050: int; bar129052: typedesc[int]): int =
|
||||
foo129050
|
||||
|
||||
nimout: '''
|
||||
IntLit 5
|
||||
proc (x: int): string => typeDesc[proc[string, int]]
|
||||
proc (x: int): void => typeDesc[proc[void, int]]
|
||||
proc (x: int) => typeDesc[proc[void, int]]
|
||||
x => uncheckedArray[int]
|
||||
x => UncheckedArray[int]
|
||||
a
|
||||
s
|
||||
d
|
||||
@@ -43,8 +40,8 @@ block t7723:
|
||||
proc init(foo: int, bar: typedesc[int]): int =
|
||||
foo
|
||||
|
||||
expandMacros:
|
||||
foo1()
|
||||
#expandMacros:
|
||||
foo1()
|
||||
|
||||
doAssert init(1, int) == 1
|
||||
|
||||
@@ -144,11 +141,11 @@ block t1140:
|
||||
result.parse_template body[1].strVal
|
||||
|
||||
|
||||
proc actual: string = tmpli html"""
|
||||
proc actual: string {.used.} = tmpli html"""
|
||||
<p>Test!</p>
|
||||
"""
|
||||
|
||||
proc another: string = tmpli html"""
|
||||
proc another: string {.used.} = tmpli html"""
|
||||
<p>what</p>
|
||||
"""
|
||||
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
discard """
|
||||
msg: '''
|
||||
range[0 .. 100]
|
||||
array[0 .. 100, int]
|
||||
10
|
||||
test
|
||||
nimout: '''
|
||||
Infix
|
||||
Ident "=>"
|
||||
Call
|
||||
Ident "name"
|
||||
Ident "a"
|
||||
ExprColonExpr
|
||||
Ident "b"
|
||||
Ident "cint"
|
||||
NilLit
|
||||
'''
|
||||
|
||||
output: '''
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
discard """
|
||||
msg: '''letters
|
||||
nimout: '''
|
||||
letters
|
||||
aa
|
||||
bb
|
||||
numbers
|
||||
@@ -8,7 +9,7 @@ numbers
|
||||
AST a
|
||||
[(11, 22), (33, 44)]
|
||||
AST b
|
||||
(e: [55, 66], f: [77, 88])
|
||||
([55, 66], [77, 88])
|
||||
55
|
||||
10
|
||||
20Test
|
||||
@@ -44,10 +45,10 @@ const
|
||||
b : Tb = (@[55,66], @[77, 88])
|
||||
|
||||
macro mA(data: static[Ta]): untyped =
|
||||
echo "AST a \n", repr(data)
|
||||
echo "AST a\n", repr(data)
|
||||
|
||||
macro mB(data: static[Tb]): untyped =
|
||||
echo "AST b \n", repr(data)
|
||||
echo "AST b\n", repr(data)
|
||||
echo data.e[0]
|
||||
|
||||
mA(a)
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
discard """
|
||||
msg: '''int int
|
||||
float float
|
||||
int int
|
||||
TFoo TFoo
|
||||
int float
|
||||
TFoo TFoo'''
|
||||
output: '''ok'''
|
||||
"""
|
||||
|
||||
import typetraits
|
||||
@@ -86,3 +81,4 @@ reject bindArg(int, int, 10, 20, 30, "test")
|
||||
reject bindArg(int, string, 10.0, 20, "test", "nest")
|
||||
reject bindArg(int, string, "test", "nest", 10, 20)
|
||||
|
||||
echo "ok"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: "static 10\ndynamic\nstatic 20\n"
|
||||
nimout: "static 10\ndynamic\nstatic 20\n"
|
||||
output: "s\nd\nd\ns"
|
||||
"""
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: '''letters
|
||||
nimout: '''letters
|
||||
aa
|
||||
bb
|
||||
numbers
|
||||
@@ -8,7 +8,7 @@ numbers
|
||||
AST a
|
||||
[(11, 22), (33, 44)]
|
||||
AST b
|
||||
(e: [55, 66], f: [77, 88])
|
||||
([55, 66], [77, 88])
|
||||
55
|
||||
10
|
||||
20Test
|
||||
@@ -44,10 +44,10 @@ const
|
||||
b : Tb = (@[55,66], @[77, 88])
|
||||
|
||||
macro mA(data: static[Ta]): untyped =
|
||||
echo "AST a \n", repr(data)
|
||||
echo "AST a\n", repr(data)
|
||||
|
||||
macro mB(data: static[Tb]): untyped =
|
||||
echo "AST b \n", repr(data)
|
||||
echo "AST b\n", repr(data)
|
||||
echo data.e[0]
|
||||
|
||||
mA(a)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: "int\nstring\nTBar[int]"
|
||||
nimout: "int\nstring\nTBar[int]"
|
||||
output: "int\nstring\nTBar[int]\nint\nrange 0..2(int)\nstring"
|
||||
disabled: true
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: "test 1\ntest 2\ntest 3"
|
||||
nimout: "test 1\ntest 2\ntest 3"
|
||||
output: "TEST 1\nTEST 2\nTEST 3"
|
||||
"""
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
discard """
|
||||
cmd: "nim default $file"
|
||||
output: '''hello world! 0.5'''
|
||||
msg: '''[NimScript] exec: gcc -v'''
|
||||
nimout: '''[NimScript] exec: gcc -v'''
|
||||
"""
|
||||
|
||||
when not defined(definedefine):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: "Warning: cannot prove that field 'x.s' is accessible [ProveField]"
|
||||
nimout: "Warning: cannot prove that field 'x.s' is accessible [ProveField]"
|
||||
line:51
|
||||
action: run
|
||||
output: "abc abc"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
disabled: "appveyor"
|
||||
disabled: "windows"
|
||||
"""
|
||||
|
||||
# appveyor is "out of memory"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: "instantiated for string\ninstantiated for int\ninstantiated for bool"
|
||||
nimout: "instantiated for string\ninstantiated for int\ninstantiated for bool"
|
||||
output: "int\nseq[string]\nA\nB\n100\ntrue"
|
||||
"""
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: '''true
|
||||
nimout: '''true
|
||||
true
|
||||
true
|
||||
true
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: '''61'''
|
||||
nimout: '''61'''
|
||||
"""
|
||||
|
||||
# bug #2297
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
disabled: "appveyor"
|
||||
disabled: "windows"
|
||||
"""
|
||||
|
||||
# If your os is windows and this test fails for you locally, please
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: '''Hello fred , managed by sally
|
||||
nimout: '''Hello fred , managed by sally
|
||||
Hello sally , managed by bob'''
|
||||
"""
|
||||
# bug #3973
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: '''13'''
|
||||
nimout: '''13'''
|
||||
output: '''3
|
||||
3
|
||||
3'''
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: "abc xyz bb"
|
||||
nimout: "abc xyz bb"
|
||||
"""
|
||||
|
||||
# bug #2473
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: '''1
|
||||
nimout: '''1
|
||||
2
|
||||
3
|
||||
1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
msg: '''
|
||||
nimout: '''
|
||||
x.data = @[10]
|
||||
y = @[11]
|
||||
x.data = @[11]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import macros
|
||||
|
||||
discard """
|
||||
msg: '''
|
||||
nimout: '''
|
||||
8 9 17
|
||||
239 255
|
||||
61439 65534 65535
|
||||
|
||||
Reference in New Issue
Block a user