added some more test cases

This commit is contained in:
0rphon 2022-02-23 15:07:32 -08:00
parent c767907b25
commit ba6f235937
4 changed files with 32 additions and 0 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
/tmp/
**.idea/
*.DS_Store
.vscode
**/process.yml

View File

@ -1,3 +1,4 @@
@REM cargo test --package leo-parser --lib -- test::parser_tests --exact --nocapture cargo 2>&1 | rp -B 2 dbg
set CLEAR_LEO_TEST_EXPECTATIONS=1
cargo test --package leo-parser --lib -- test::parser_tests --exact --nocapture
set CLEAR_LEO_TEST_EXPECTATIONS=

View File

@ -33,3 +33,13 @@ outputs:
- "Error [EPAR0370003]: unexpected EOF\n --> test:1:5\n |\n 1 | let x\n | ^"
- "Error [EPAR0370003]: unexpected EOF\n --> test:1:6\n |\n 1 | let x:\n | ^"
- "Error [EPAR0370005]: expected ) -- got ']'\n --> test:1:14\n |\n 1 | let x = (a, y]);\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'ident', got '='\n --> test:1:5\n |\n 1 | let = 1u8;\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'ident', got ';'\n --> test:1:4\n |\n 1 | let;\n | ^"
- "Error [EPAR0370005]: expected = -- got '1'\n --> test:1:7\n |\n 1 | let x 1u8;\n | ^"
- "Error [EPAR0370005]: expected = -- got ';'\n --> test:1:10\n |\n 1 | let x: u8;\n | ^"
- "Error [EPAR0370003]: unexpected EOF\n --> test:1:8\n |\n 1 | let x: u8\n | ^^"
- "Error [EPAR0370005]: expected 'i8', 'i16', 'i32', 'i64', 'i128', 'u8', 'u16', 'u32', 'u64', 'u128', 'field', 'group', 'address', 'bool', 'char' -- got '='\n --> test:1:8\n |\n 1 | let x: = 1;\n | ^"
- "Error [EPAR0370005]: expected ; -- got ']'\n --> test:1:11\n |\n 1 | let x: [u8] = 1;\n | ^"
- "Error [EPAR0370003]: unexpected EOF\n --> test:1:11\n |\n 1 | let x: [u8;\n | ^"
- "Error [EPAR0370005]: expected ] -- got 'u8'\n --> test:1:14\n |\n 1 | let x: [u8; 1u8] = [1,\n | ^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got ']'\n --> test:1:15\n |\n 1 | let dbg: u8 = ];\n | ^"

View File

@ -69,3 +69,23 @@ let x
let x:
let x = (a, y]);
let = 1u8;
let;
let x 1u8;
let x: u8;
let x: u8
let x: = 1;
let x: [u8] = 1;
let x: [u8;
let x: [u8; 1u8] = [1,
let dbg: u8 = ];