Add some tests
This commit is contained in:
parent
48cb618d5a
commit
89a7780d10
|
@ -0,0 +1,8 @@
|
|||
//invalid,Function name print at 1:22 is already an intrinsic
|
||||
|
||||
function int => print
|
||||
{
|
||||
deq
|
||||
}
|
||||
|
||||
42 print
|
|
@ -0,0 +1,8 @@
|
|||
//invalid,Expected function name but got deq at 3:20
|
||||
|
||||
function int => deq
|
||||
{
|
||||
deq
|
||||
}
|
||||
|
||||
42 print
|
|
@ -0,0 +1,6 @@
|
|||
//invalid,Expected function name but got { at 2:2
|
||||
|
||||
function int =>
|
||||
{
|
||||
deq
|
||||
}
|
|
@ -1,3 +1,6 @@
|
|||
//valid
|
||||
//output: Hello, World!\n4242test2Falsetesttesttest
|
||||
|
||||
"Hello, World!\n" print 43 foo foo deq
|
||||
|
||||
|
||||
|
@ -33,4 +36,4 @@ function int => whileFunction
|
|||
deq
|
||||
}
|
||||
|
||||
42 whileFunction
|
||||
3 whileFunction
|
|
@ -0,0 +1,8 @@
|
|||
//valid,output:42footesttest2stuff
|
||||
|
||||
function int str any => str str str foo
|
||||
{
|
||||
print req deq "test" "test2" "stuff" print
|
||||
}
|
||||
|
||||
42 "foo" "bar" foo print print print
|
|
@ -0,0 +1,2 @@
|
|||
//invalid,Call to unknown function foo at 1:4
|
||||
foo
|
|
@ -0,0 +1,19 @@
|
|||
//invalid,Call to unknown function bar at 7:7
|
||||
|
||||
function int => foo
|
||||
{
|
||||
while
|
||||
{
|
||||
if
|
||||
{
|
||||
bar
|
||||
}
|
||||
else
|
||||
{
|
||||
1 -
|
||||
}
|
||||
}
|
||||
deq
|
||||
}
|
||||
|
||||
42 foo
|
|
@ -0,0 +1,8 @@
|
|||
//invalid,Call to unknown function bar at 3:5
|
||||
|
||||
function => foo
|
||||
{
|
||||
bar
|
||||
}
|
||||
|
||||
foo
|
Loading…
Reference in New Issue