Skip to content

Commit

Permalink
fix parser tests
Browse files Browse the repository at this point in the history
  • Loading branch information
collinc97 committed Apr 15, 2021
1 parent 717fa49 commit 1fee0d3
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 56 deletions.
4 changes: 2 additions & 2 deletions tests/parser/expression/array_init_fail.leo.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
namespace: ParseExpression
expectation: Fail
outputs:
- " --> test: 1:1\n |\n 1 | [...0u8; 1]\n | ^^^^^^^\n |\n = illegal spread in array initializer"
- " --> test: 1:1\n |\n 1 | [...0; 1]\n | ^^^^^\n |\n = illegal spread in array initializer"
- " --> test:1:1\n |\n 1 | [...0u8; 1]\n | ^^^^^^^\n |\n = illegal spread in array initializer"
- " --> test:1:1\n |\n 1 | [...0; 1]\n | ^^^^^\n |\n = illegal spread in array initializer"
10 changes: 5 additions & 5 deletions tests/parser/expression/array_inline_fail.leo.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
namespace: ParseExpression
expectation: Fail
outputs:
- " --> test: 1:2\n |\n 1 | [,]\n | ^\n |\n = expected 'expression', got ','"
- " --> test: 1:2\n |\n 1 | [,,]\n | ^\n |\n = expected 'expression', got ','"
- " --> test: 1:4\n |\n 1 | [0,,]\n | ^\n |\n = expected 'expression', got ','"
- " --> test: 1:2\n |\n 1 | [,0]\n | ^\n |\n = expected 'expression', got ','"
- " --> test: 1:2\n |\n 1 | [,0,]\n | ^\n |\n = expected 'expression', got ','"
- " --> test:1:2\n |\n 1 | [,]\n | ^\n |\n = expected 'expression', got ','"
- " --> test:1:2\n |\n 1 | [,,]\n | ^\n |\n = expected 'expression', got ','"
- " --> test:1:4\n |\n 1 | [0,,]\n | ^\n |\n = expected 'expression', got ','"
- " --> test:1:2\n |\n 1 | [,0]\n | ^\n |\n = expected 'expression', got ','"
- " --> test:1:2\n |\n 1 | [,0,]\n | ^\n |\n = expected 'expression', got ','"
22 changes: 11 additions & 11 deletions tests/parser/expression/circuit_init_fail.leo.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
namespace: ParseExpression
expectation: Fail
outputs:
- " --> test: 1:3\n |\n 1 | x {\n | ^\n |\n = unexpected EOF"
- " --> test:1:3\n |\n 1 | x {\n | ^\n |\n = unexpected EOF"
- "did not consume all input: '}' @ 1:3-4\n"
- " --> test: 1:4\n |\n 1 | x {,}\n | ^\n |\n = expected 'ident', got ','"
- " --> test: 1:5\n |\n 1 | x { , }\n | ^\n |\n = expected 'ident', got ','"
- " --> test: 1:4\n |\n 1 | x {,,,}\n | ^\n |\n = expected 'ident', got ','"
- " --> test: 1:6\n |\n 1 | x {x,,}\n | ^\n |\n = expected 'ident', got ','"
- " --> test: 1:4\n |\n 1 | x {,,x}\n | ^\n |\n = expected 'ident', got ','"
- " --> test: 1:4\n |\n 1 | x {,x}\n | ^\n |\n = expected 'ident', got ','"
- " --> test: 1:8\n |\n 1 | x {x:y,,}\n | ^\n |\n = expected 'ident', got ','"
- " --> test: 1:4\n |\n 1 | x {,,x:y}\n | ^\n |\n = expected 'ident', got ','"
- " --> test: 1:4\n |\n 1 | x {,x:y}\n | ^\n |\n = expected 'ident', got ','"
- " --> test: 1:6\n |\n 1 | x {x:}\n | ^\n |\n = expected 'expression', got '}'"
- " --> test:1:4\n |\n 1 | x {,}\n | ^\n |\n = expected 'ident', got ','"
- " --> test:1:5\n |\n 1 | x { , }\n | ^\n |\n = expected 'ident', got ','"
- " --> test:1:4\n |\n 1 | x {,,,}\n | ^\n |\n = expected 'ident', got ','"
- " --> test:1:6\n |\n 1 | x {x,,}\n | ^\n |\n = expected 'ident', got ','"
- " --> test:1:4\n |\n 1 | x {,,x}\n | ^\n |\n = expected 'ident', got ','"
- " --> test:1:4\n |\n 1 | x {,x}\n | ^\n |\n = expected 'ident', got ','"
- " --> test:1:8\n |\n 1 | x {x:y,,}\n | ^\n |\n = expected 'ident', got ','"
- " --> test:1:4\n |\n 1 | x {,,x:y}\n | ^\n |\n = expected 'ident', got ','"
- " --> test:1:4\n |\n 1 | x {,x:y}\n | ^\n |\n = expected 'ident', got ','"
- " --> test:1:6\n |\n 1 | x {x:}\n | ^\n |\n = expected 'expression', got '}'"
18 changes: 9 additions & 9 deletions tests/parser/expression/literal/address_fail.leo.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
namespace: Token
expectation: Fail
outputs:
- " --> test: 1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1'"
- " --> test: 1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6Z2eu975wnpz2925ntjccd5cfqxtyu8sta57J9\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6Z2eu975wnpz2925ntjccd5cfqxtyu8sta57J9'"
- " --> test: 1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d'"
- " --> test: 1:1\n |\n 1 | aleo1\n | ^^^^^\n |\n = invalid address literal: 'aleo1'"
- " --> test: 1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8st\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8st'"
- " --> test: 1:1\n |\n 1 | aleo1\n | ^^^^^\n |\n = invalid address literal: 'aleo1'"
- " --> test: 1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1'"
- " --> test: 1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d11\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d11'"
- " --> test: 1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1x\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1x'"
- " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1'"
- " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6Z2eu975wnpz2925ntjccd5cfqxtyu8sta57J9\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6Z2eu975wnpz2925ntjccd5cfqxtyu8sta57J9'"
- " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d'"
- " --> test:1:1\n |\n 1 | aleo1\n | ^^^^^\n |\n = invalid address literal: 'aleo1'"
- " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8st\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8st'"
- " --> test:1:1\n |\n 1 | aleo1\n | ^^^^^\n |\n = invalid address literal: 'aleo1'"
- " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1aleo1'"
- " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d11\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d11'"
- " --> test:1:1\n |\n 1 | aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1x\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = invalid address literal: 'aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57d1x'"
8 changes: 4 additions & 4 deletions tests/parser/expression/literal/group_fail.leo.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
namespace: ParseExpression
expectation: Fail
outputs:
- " --> test: 1:1\n |\n 1 | group\n | ^^^^^\n |\n = expected 'expression', got 'group'"
- " --> test:1:1\n |\n 1 | group\n | ^^^^^\n |\n = expected 'expression', got 'group'"
- "did not consume all input: 'group' @ 1:3-8\n"
- "did not consume all input: 'group' @ 1:6-11\n"
- " --> test: 1:2\n |\n 1 | (,)group\n | ^\n |\n = expected 'expression', got ','"
- " --> test: 1:2\n |\n 1 | (+, -,)group\n | ^\n |\n = expected 'expression', got '+'"
- " --> test: 1:2\n |\n 1 | (,+, -)group\n | ^\n |\n = expected 'expression', got ','"
- " --> test:1:2\n |\n 1 | (,)group\n | ^\n |\n = expected 'expression', got ','"
- " --> test:1:2\n |\n 1 | (+, -,)group\n | ^\n |\n = expected 'expression', got '+'"
- " --> test:1:2\n |\n 1 | (,+, -)group\n | ^\n |\n = expected 'expression', got ','"
- "did not consume all input: 'group' @ 1:6-11\n"
- "did not consume all input: 'group' @ 1:12-17\n"
- "did not consume all input: 'group' @ 1:15-20\n"
2 changes: 1 addition & 1 deletion tests/parser/functions/const_input_fail.leo.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
namespace: Parse
expectation: Fail
outputs:
- " --> test: 3:18\n |\n 3 | function x(const input) {\n | ^^^^^\n |\n = expected 'ident', got 'input'"
- " --> test:3:18\n |\n 3 | function x(const input) {\n | ^^^^^\n |\n = expected 'ident', got 'input'"
2 changes: 1 addition & 1 deletion tests/parser/functions/input_typed_fail.leo.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
namespace: Parse
expectation: Fail
outputs:
- " --> test: 3:17\n |\n 3 | function x(input: u32) {\n | ^\n |\n = expected ')' -- got ':'"
- " --> test:3:17\n |\n 3 | function x(input: u32) {\n | ^\n |\n = expected ')' -- got ':'"
46 changes: 23 additions & 23 deletions tests/parser/statement/definition_fail.leo.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
namespace: ParseStatement
expectation: Fail
outputs:
- " --> test: 1:0\n |\n 1 | let mut x = expr;\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | let mut x = ();\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | let mut x = x+y;\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | let mut x = (x,y);\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | let mut x = x();\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | const mut x = expr;\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | const mut x = ();\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | const mut x = x+y;\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | const mut x = (x,y);\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | const mut x = x();\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | let mut x: u32 = expr;\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | let mut x: u32 = ();\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | let mut x: u32 = x+y;\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | let mut x: u32 = (x,y);\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | let mut x: u32 = x();\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | const mut x: u32 = expr;\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | const mut x: u32 = ();\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | const mut x: u32 = x+y;\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | const mut x: u32 = (x,y);\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:0\n |\n 1 | const mut x: u32 = x();\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test: 1:10\n |\n 1 | let (x,y,,) = ();\n | ^\n |\n = expected 'ident', got ','"
- " --> test: 1:6\n |\n 1 | let (,x,y) = ();\n | ^\n |\n = expected 'ident', got ','"
- " --> test: 1:8\n |\n 1 | let (x,,y) = ();\n | ^\n |\n = expected 'ident', got ','"
- " --> test:1:0\n |\n 1 | let mut x = expr;\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | let mut x = ();\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | let mut x = x+y;\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | let mut x = (x,y);\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | let mut x = x();\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | const mut x = expr;\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | const mut x = ();\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | const mut x = x+y;\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | const mut x = (x,y);\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | const mut x = x();\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | let mut x: u32 = expr;\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | let mut x: u32 = ();\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | let mut x: u32 = x+y;\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | let mut x: u32 = (x,y);\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | let mut x: u32 = x();\n |^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | const mut x: u32 = expr;\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | const mut x: u32 = ();\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | const mut x: u32 = x+y;\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | const mut x: u32 = (x,y);\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:0\n |\n 1 | const mut x: u32 = x();\n |^^^^^^^^^\n |\n = let mut = ... is deprecated. `let` keyword implies mutabality by default."
- " --> test:1:10\n |\n 1 | let (x,y,,) = ();\n | ^\n |\n = expected 'ident', got ','"
- " --> test:1:6\n |\n 1 | let (,x,y) = ();\n | ^\n |\n = expected 'ident', got ','"
- " --> test:1:8\n |\n 1 | let (x,,y) = ();\n | ^\n |\n = expected 'ident', got ','"

0 comments on commit 1fee0d3

Please sign in to comment.