forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update all the E2E should_fail tests to verify their output. (FuelLab…
…s#2082) Using the `FileCheck` crate it can now pattern match against the compiler output to be sure the errors and/or warnings are exactly what we expect.
- Loading branch information
Showing
95 changed files
with
627 additions
and
33 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
test/src/e2e_vm_tests/test_programs/should_fail/abi_impl_purity_mismatch/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
category = "fail" | ||
|
||
# check: $()Storage attribute access mismatch. The trait function "test_function" in trait "MyContract" requires the storage attribute(s) #[storage(read)]. |
4 changes: 4 additions & 0 deletions
4
test/src/e2e_vm_tests/test_programs/should_fail/abi_method_signature_mismatch/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
category = "fail" | ||
|
||
# check: fn foo(s: str[7]) -> str[7] { | ||
# nextln: $()Expected: u64 | ||
# nextln: $()found: str[7]. The definition of this function must match the one in the trait declaration. |
3 changes: 3 additions & 0 deletions
3
test/src/e2e_vm_tests/test_programs/should_fail/abi_pure_calls_impure/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
category = "fail" | ||
|
||
# check: f() | ||
# nextln: $()Storage attribute access mismatch. Try giving the surrounding function more access by adding "#[storage(read)]" to the function declaration. |
15 changes: 15 additions & 0 deletions
15
test/src/e2e_vm_tests/test_programs/should_fail/abort_control_flow_bad/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
category = "fail" | ||
|
||
# check: return 42; | ||
# nextln: $()Mismatched types. | ||
# nextln: $()expected: () | ||
# nextln: $()found: u64. | ||
# nextln: $()help: Return statement must return the declared function return type. | ||
|
||
# This 'return true' line appears in both error messages.. | ||
# check: return true; | ||
|
||
# check: return true; | ||
# nextln: $()Mismatched types. | ||
# nextln: $()expected: () | ||
# nextln: $()found: bool. | ||
# nextln: $()help: Return statement must return the declared function return type. |
5 changes: 5 additions & 0 deletions
5
test/src/e2e_vm_tests/test_programs/should_fail/array_bad_index/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
category = "fail" | ||
|
||
# check: ary[false] | ||
# nextln: $()Mismatched types. | ||
# nextln: $()expected: u64 | ||
# nextln: $()found: bool. |
2 changes: 2 additions & 0 deletions
2
test/src/e2e_vm_tests/test_programs/should_fail/array_oob/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
category = "fail" | ||
|
||
# check: $()Array index out of bounds; the length is 3 but the index is 4. |
12 changes: 12 additions & 0 deletions
12
test/src/e2e_vm_tests/test_programs/should_fail/asm_missing_return/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
category = "fail" | ||
|
||
# check: asm(r1: 5) { | ||
# check: $()Mismatched types. | ||
# nextln: $()expected: u64 | ||
# nextln: $()found: (). | ||
# nextln: $()help: Implicit return must match up with block's type. | ||
|
||
# check: asm(r1: 5) { | ||
# check: $()Mismatched types. | ||
# nextln: $()expected: u64 | ||
# nextln: $()found: (). | ||
# nextln: $()help: Function body's return type does not match up with its return type annotation. |
14 changes: 14 additions & 0 deletions
14
test/src/e2e_vm_tests/test_programs/should_fail/asm_should_not_have_return/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
category = "fail" | ||
|
||
# check: // this asm block should return unit, i.e. nothing | ||
# nextln: asm(r1: 5) { | ||
# check: $()Mismatched types. | ||
# nextln: $()expected: () | ||
# nextln: $()found: u64. | ||
# nextln: $()help: Implicit return must match up with block's type. | ||
|
||
# check: // this asm block should return unit, i.e. nothing | ||
# nextln: asm(r1: 5) { | ||
# check: $()Mismatched types. | ||
# nextln: $()expected: () | ||
# nextln: $()found: u64. | ||
# nextln: $()help: Function body's return type does not match up with its return type annotation. |
2 changes: 2 additions & 0 deletions
2
...rc/e2e_vm_tests/test_programs/should_fail/assign_to_field_of_non_mutable_struct/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
category = "fail" | ||
|
||
# check: $()Assignment to immutable variable. Variable thing is not declared as mutable. |
6 changes: 6 additions & 0 deletions
6
test/src/e2e_vm_tests/test_programs/should_fail/bad_generic_annotation/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
category = "fail" | ||
|
||
# check: let g: u32 = three_generics(true, "foo", 10); | ||
# nextln: $()Mismatched types. | ||
# nextln: $()expected: u32 | ||
# nextln: $()found: str[3]. | ||
# nextln: $()help: Variable declaration's type annotation does not match up with the assigned expression's type. |
Oops, something went wrong.