mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-12-25 05:43:19 +03:00
Add parse error tests from Blodwen
This commit is contained in:
parent
f9ea1ff329
commit
17c862fe00
@ -39,6 +39,8 @@ idrisTests
|
||||
"import001", "import002",
|
||||
"lazy001",
|
||||
"linear001", "linear002", "linear003", "linear004", "linear005",
|
||||
"perror001", "perror002", "perror003", "perror004", "perror005",
|
||||
"perror006",
|
||||
"record001", "record002",
|
||||
"total001", "total002", "total003", "total004", "total005",
|
||||
"total006"]
|
||||
|
8
tests/idris2/perror001/PError.idr
Normal file
8
tests/idris2/perror001/PError.idr
Normal file
@ -0,0 +1,8 @@
|
||||
foo : Int -> Int
|
||||
foo x = x
|
||||
|
||||
bar : (Int -> Int
|
||||
bar x = let y = 42 in y + x
|
||||
|
||||
baz : Int -> Int
|
||||
baz x = x
|
1
tests/idris2/perror001/expected
Normal file
1
tests/idris2/perror001/expected
Normal file
@ -0,0 +1 @@
|
||||
PError.idr:5:1--5:1:Parse error: Expected ')' (next tokens: [identifier bar, identifier x, symbol =, let, identifier y, symbol =, literal 42, in, identifier y, symbol +])
|
3
tests/idris2/perror001/run
Executable file
3
tests/idris2/perror001/run
Executable file
@ -0,0 +1,3 @@
|
||||
$1 --check PError.idr
|
||||
|
||||
rm -rf build
|
8
tests/idris2/perror002/PError.idr
Normal file
8
tests/idris2/perror002/PError.idr
Normal file
@ -0,0 +1,8 @@
|
||||
foo : Int -> Int
|
||||
foo x = x
|
||||
|
||||
bar : Int -> Int
|
||||
bar x = let y = 42 in (y + x
|
||||
|
||||
baz : Int -> Int
|
||||
baz x = x
|
1
tests/idris2/perror002/expected
Normal file
1
tests/idris2/perror002/expected
Normal file
@ -0,0 +1 @@
|
||||
PError.idr:7:1--7:1:Parse error: Expected ')' (next tokens: [identifier baz, symbol :, Int, symbol ->, Int, identifier baz, identifier x, symbol =, identifier x, end of input])
|
3
tests/idris2/perror002/run
Executable file
3
tests/idris2/perror002/run
Executable file
@ -0,0 +1,3 @@
|
||||
$1 --check PError.idr
|
||||
|
||||
rm -rf build
|
8
tests/idris2/perror003/PError.idr
Normal file
8
tests/idris2/perror003/PError.idr
Normal file
@ -0,0 +1,8 @@
|
||||
foo : Int -> Int
|
||||
foo x = x
|
||||
|
||||
bar : Int -> Int
|
||||
bar x = let y = (42 in y + x
|
||||
|
||||
baz : Int -> Int
|
||||
baz x = x
|
1
tests/idris2/perror003/expected
Normal file
1
tests/idris2/perror003/expected
Normal file
@ -0,0 +1 @@
|
||||
PError.idr:5:17--5:17:Parse error: Expected 'case', 'if', 'do', application or operator expression (next tokens: [symbol (, literal 42, in, identifier y, symbol +, identifier x, identifier baz, symbol :, Int, symbol ->])
|
3
tests/idris2/perror003/run
Executable file
3
tests/idris2/perror003/run
Executable file
@ -0,0 +1,3 @@
|
||||
$1 --check PError.idr
|
||||
|
||||
rm -rf build
|
6
tests/idris2/perror004/PError.idr
Normal file
6
tests/idris2/perror004/PError.idr
Normal file
@ -0,0 +1,6 @@
|
||||
foo : Nat -> Nat -> Bool
|
||||
foo x y with (x == y)
|
||||
foo x y | True with (y == x)
|
||||
foo x y | True | False | 10 = x
|
||||
foo x y | True | True = x
|
||||
foo x y | False = y
|
1
tests/idris2/perror004/expected
Normal file
1
tests/idris2/perror004/expected
Normal file
@ -0,0 +1 @@
|
||||
PError.idr:4:33--4:33:Parse error: Wrong number of 'with' arguments (next tokens: [symbol =, identifier x, identifier foo, identifier x, identifier y, symbol |, identifier True, symbol |, identifier True, symbol =])
|
3
tests/idris2/perror004/run
Executable file
3
tests/idris2/perror004/run
Executable file
@ -0,0 +1,3 @@
|
||||
$1 --check PError.idr
|
||||
|
||||
rm -rf build
|
8
tests/idris2/perror005/PError.idr
Normal file
8
tests/idris2/perror005/PError.idr
Normal file
@ -0,0 +1,8 @@
|
||||
foo : Int -> Int
|
||||
foo x = x
|
||||
|
||||
bar : Int -> Int
|
||||
bar x = let y = 42
|
||||
|
||||
baz : Int -> Int
|
||||
baz x = x
|
1
tests/idris2/perror005/expected
Normal file
1
tests/idris2/perror005/expected
Normal file
@ -0,0 +1 @@
|
||||
PError.idr:7:1--7:1:Parse error: Expected 'in' (next tokens: [identifier baz, symbol :, Int, symbol ->, Int, identifier baz, identifier x, symbol =, identifier x, end of input])
|
3
tests/idris2/perror005/run
Executable file
3
tests/idris2/perror005/run
Executable file
@ -0,0 +1,3 @@
|
||||
$1 --check PError.idr
|
||||
|
||||
rm -rf build
|
8
tests/idris2/perror006/PError.idr
Normal file
8
tests/idris2/perror006/PError.idr
Normal file
@ -0,0 +1,8 @@
|
||||
foo : Int -> Int
|
||||
foo x = x
|
||||
|
||||
bar : Int -> Int
|
||||
bar x = if x == 95 then 0
|
||||
|
||||
baz : Int -> Int
|
||||
baz x = x
|
1
tests/idris2/perror006/expected
Normal file
1
tests/idris2/perror006/expected
Normal file
@ -0,0 +1 @@
|
||||
PError.idr:7:1--7:1:Parse error: Expected 'else' (next tokens: [identifier baz, symbol :, Int, symbol ->, Int, identifier baz, identifier x, symbol =, identifier x, end of input])
|
3
tests/idris2/perror006/run
Executable file
3
tests/idris2/perror006/run
Executable file
@ -0,0 +1,3 @@
|
||||
$1 --check PError.run
|
||||
|
||||
rm -rf build
|
Loading…
Reference in New Issue
Block a user