adjust tests

This commit is contained in:
gluax 2022-04-05 11:38:21 -07:00
parent 4c7903f5c3
commit 3a85223e22
4 changed files with 6 additions and 433 deletions

View File

@ -159,19 +159,14 @@ mod tests {
) )
* *
** **
**=
*=
+ +
+=
, ,
- -
-=
-> ->
_ _
. .
.. ..
/ /
/=
: :
; ;
< <
@ -199,7 +194,7 @@ mod tests {
assert_eq!( assert_eq!(
output, output,
r#"'a' '😭' "test" "test{}test" "test{}" "{}test" "test{" "test}" "test{test" "test}test" "te{{}}" aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 test_ident 12345 address bool const else false field for function group i128 i64 i32 i16 i8 if in input let mut return string test true u128 u64 u32 u16 u8 console ! != && ( ) * ** **= *= + += , - -= -> _ . .. / /= : ; < <= = == > >= [ ] { { } } || ? // test r#"'a' '😭' "test" "test{}test" "test{}" "{}test" "test{" "test}" "test{test" "test}test" "te{{}}" aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8 test_ident 12345 address bool const else false field for function group i128 i64 i32 i16 i8 if in input let mut return string test true u128 u64 u32 u16 u8 console ! != && ( ) * ** + , - -> _ . .. / : ; < <= = == > >= [ ] { { } } || ? // test
/* test */ // "# /* test */ // "#
); );
}); });

View File

@ -25,11 +25,11 @@ outputs:
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '**'\n --> test:1:1\n |\n 1 | **\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '**'\n --> test:1:1\n |\n 1 | **\n | ^^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '/'\n --> test:1:1\n |\n 1 | /\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '/'\n --> test:1:1\n |\n 1 | /\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:1\n |\n 1 | =\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:1\n |\n 1 | =\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '+='\n --> test:1:1\n |\n 1 | +=\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '+'\n --> test:1:1\n |\n 1 | +=\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '-='\n --> test:1:1\n |\n 1 | -=\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:2\n |\n 1 | -=\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '*='\n --> test:1:1\n |\n 1 | *=\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '*'\n --> test:1:1\n |\n 1 | *=\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '/='\n --> test:1:1\n |\n 1 | /=\n | ^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '/'\n --> test:1:1\n |\n 1 | /=\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '**='\n --> test:1:1\n |\n 1 | **=\n | ^^^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '**'\n --> test:1:1\n |\n 1 | **=\n | ^^"
- "Error [EPAR0370003]: unexpected EOF\n --> test:1:1\n |\n 1 | (\n | ^" - "Error [EPAR0370003]: unexpected EOF\n --> test:1:1\n |\n 1 | (\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got ')'\n --> test:1:1\n |\n 1 | )\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got ')'\n --> test:1:1\n |\n 1 | )\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [\n | ^" - "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [\n | ^"

View File

@ -87,397 +87,3 @@ outputs:
col_stop: 8 col_stop: 8
path: "" path: ""
content: x = x(); content: x = x();
- Assign:
operation: Add
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x += expr;\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x += expr;
value:
Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x += expr;\\\"}\"}"
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 10
path: ""
content: x += expr;
- Assign:
operation: Add
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x += x+y;\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x += x+y;
value:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x += x+y;\\\"}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x += x+y;\\\"}\"}"
op: Add
span:
line_start: 1
line_stop: 1
col_start: 6
col_stop: 9
path: ""
content: x += x+y;
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 9
path: ""
content: x += x+y;
- Assign:
operation: Add
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x += x();\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x += x();
value:
Call:
function:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x += x();\\\"}\"}"
arguments: []
span:
line_start: 1
line_stop: 1
col_start: 6
col_stop: 9
path: ""
content: x += x();
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 9
path: ""
content: x += x();
- Assign:
operation: Sub
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x -= expr;\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x -= expr;
value:
Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x -= expr;\\\"}\"}"
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 10
path: ""
content: x -= expr;
- Assign:
operation: Sub
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x -= x+y;\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x -= x+y;
value:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x -= x+y;\\\"}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x -= x+y;\\\"}\"}"
op: Add
span:
line_start: 1
line_stop: 1
col_start: 6
col_stop: 9
path: ""
content: x -= x+y;
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 9
path: ""
content: x -= x+y;
- Assign:
operation: Sub
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x -= x();\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x -= x();
value:
Call:
function:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x -= x();\\\"}\"}"
arguments: []
span:
line_start: 1
line_stop: 1
col_start: 6
col_stop: 9
path: ""
content: x -= x();
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 9
path: ""
content: x -= x();
- Assign:
operation: Mul
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x *= expr;\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x *= expr;
value:
Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x *= expr;\\\"}\"}"
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 10
path: ""
content: x *= expr;
- Assign:
operation: Mul
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x *= x+y;\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x *= x+y;
value:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x *= x+y;\\\"}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x *= x+y;\\\"}\"}"
op: Add
span:
line_start: 1
line_stop: 1
col_start: 6
col_stop: 9
path: ""
content: x *= x+y;
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 9
path: ""
content: x *= x+y;
- Assign:
operation: Mul
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x *= x();\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x *= x();
value:
Call:
function:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x *= x();\\\"}\"}"
arguments: []
span:
line_start: 1
line_stop: 1
col_start: 6
col_stop: 9
path: ""
content: x *= x();
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 9
path: ""
content: x *= x();
- Assign:
operation: Div
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x /= expr;\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x /= expr;
value:
Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x /= expr;\\\"}\"}"
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 10
path: ""
content: x /= expr;
- Assign:
operation: Div
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x /= x+y;\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x /= x+y;
value:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x /= x+y;\\\"}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x /= x+y;\\\"}\"}"
op: Add
span:
line_start: 1
line_stop: 1
col_start: 6
col_stop: 9
path: ""
content: x /= x+y;
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 9
path: ""
content: x /= x+y;
- Assign:
operation: Div
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x /= x();\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x /= x();
value:
Call:
function:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":7,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x /= x();\\\"}\"}"
arguments: []
span:
line_start: 1
line_stop: 1
col_start: 6
col_stop: 9
path: ""
content: x /= x();
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 9
path: ""
content: x /= x();
- Assign:
operation: Pow
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x **= expr;\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x **= expr;
value:
Identifier: "{\"name\":\"expr\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x **= expr;\\\"}\"}"
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 11
path: ""
content: x **= expr;
- Assign:
operation: Pow
assignee:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x **= x+y;\\\"}\"}"
accesses: []
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 2
path: ""
content: x **= x+y;
value:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x **= x+y;\\\"}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":9,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x **= x+y;\\\"}\"}"
op: Add
span:
line_start: 1
line_stop: 1
col_start: 7
col_stop: 10
path: ""
content: x **= x+y;
span:
line_start: 1
line_stop: 1
col_start: 1
col_stop: 10
path: ""
content: x **= x+y;

View File

@ -8,31 +8,3 @@ x = expr;
x = x+y; x = x+y;
x = x(); x = x();
x += expr;
x += x+y;
x += x();
x -= expr;
x -= x+y;
x -= x();
x *= expr;
x *= x+y;
x *= x();
x /= expr;
x /= x+y;
x /= x();
x **= expr;
x **= x+y;