From 6f57c6e2ce3e1f03828ff9569b05a2b598c98004 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Wed, 5 Apr 2023 09:14:17 -0700 Subject: [PATCH] Cleanup and regen expectations --- .../compiler/finalize/increment_decrement_in_inline.out | 5 ----- .../compiler/records/return_record_instead_of_unit_fail.out | 5 +++++ .../compiler/tuple/function_return_zero_fail.out | 5 ----- ...eturn_fail.leo => return_record_instead_of_unit_fail.leo} | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 tests/expectations/compiler/finalize/increment_decrement_in_inline.out create mode 100644 tests/expectations/compiler/records/return_record_instead_of_unit_fail.out delete mode 100644 tests/expectations/compiler/tuple/function_return_zero_fail.out rename tests/tests/compiler/records/{force_record_return_fail.leo => return_record_instead_of_unit_fail.leo} (94%) diff --git a/tests/expectations/compiler/finalize/increment_decrement_in_inline.out b/tests/expectations/compiler/finalize/increment_decrement_in_inline.out deleted file mode 100644 index 4314c79e14..0000000000 --- a/tests/expectations/compiler/finalize/increment_decrement_in_inline.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Compile -expectation: Fail -outputs: - - "Error [ETYC0372035]: `increment` or `decrement` statements must be inside a finalize block.\n --> compiler-test:8:9\n |\n 8 | increment(values, 0u8, 1u8);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372035]: `increment` or `decrement` statements must be inside a finalize block.\n --> compiler-test:9:9\n |\n 9 | increment(account, self.caller, 1u64);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372035]: `increment` or `decrement` statements must be inside a finalize block.\n --> compiler-test:13:9\n |\n 13 | decrement(values, 0u8, 1u8);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372035]: `increment` or `decrement` statements must be inside a finalize block.\n --> compiler-test:14:9\n |\n 14 | decrement(account, self.caller, 1u64);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372044]: Function must contain a `finalize` statement on all execution paths.\n --> compiler-test:12:5\n |\n 12 | inline bar() {\n 13 | decrement(values, 0u8, 1u8);\n 14 | decrement(account, self.caller, 1u64);\n 15 | }\n | ^\nError [ETYC0372031]: Only transition functions can have a `finalize` block.\n --> compiler-test:17:5\n |\n 17 | finalize finalize_no_params() {\n 18 | foo();\n 19 | bar();\n 20 | }\n | ^\n |\n = Remove the `finalize` block or use the keyword `transition` instead of `function`.\nError [ETYC0372045]: `finalize` name `bar` does not match function name `finalize_no_params`\n --> compiler-test:17:5\n |\n 17 | finalize finalize_no_params() {\n 18 | foo();\n 19 | bar();\n 20 | }\n | ^\nError [ETYC0372066]: Cyclic dependency between functions: `bar` --> `bar`\n" diff --git a/tests/expectations/compiler/records/return_record_instead_of_unit_fail.out b/tests/expectations/compiler/records/return_record_instead_of_unit_fail.out new file mode 100644 index 0000000000..fe213d4d10 --- /dev/null +++ b/tests/expectations/compiler/records/return_record_instead_of_unit_fail.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [ETYC0372003]: Expected type `()` but type `test_credits` was found\n --> compiler-test:11:16\n |\n 11 | return test_credits {\n | ^^^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/tuple/function_return_zero_fail.out b/tests/expectations/compiler/tuple/function_return_zero_fail.out deleted file mode 100644 index 03ecce8660..0000000000 --- a/tests/expectations/compiler/tuple/function_return_zero_fail.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Compile -expectation: Fail -outputs: - - "Failed to parse string. Parsing Error: VerboseError { errors: [(\"closure main:\\n input r0 as boolean;\\n input r1 as boolean;\\n\", Nom(Tag)), (\"\\n\\n\\nclosure main:\\n input r0 as boolean;\\n input r1 as boolean;\\n\", Nom(Alt)), (\"\\n\\n\\nclosure main:\\n input r0 as boolean;\\n input r1 as boolean;\\n\", Nom(Many1))] }" diff --git a/tests/tests/compiler/records/force_record_return_fail.leo b/tests/tests/compiler/records/return_record_instead_of_unit_fail.leo similarity index 94% rename from tests/tests/compiler/records/force_record_return_fail.leo rename to tests/tests/compiler/records/return_record_instead_of_unit_fail.leo index f0941e228c..4eb46ba89c 100644 --- a/tests/tests/compiler/records/force_record_return_fail.leo +++ b/tests/tests/compiler/records/return_record_instead_of_unit_fail.leo @@ -1,6 +1,6 @@ /* namespace: Compile -expectation: Pass +expectation: Fail */ program test.aleo {