-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[compiler] test cases and stdlib source code updates for attributes c…
…hecks PR
- Loading branch information
1 parent
26ec3c5
commit cda4ae6
Showing
54 changed files
with
526 additions
and
27 deletions.
There are no files selected for viewing
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
84 changes: 84 additions & 0 deletions
84
third_party/move/move-compiler/tests/move_check/parser/attribute_placement.exp
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 |
---|---|---|
@@ -0,0 +1,84 @@ | ||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:3:3 | ||
│ | ||
3 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:5:7 | ||
│ | ||
5 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:8:7 | ||
│ | ||
8 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:11:7 | ||
│ | ||
11 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:14:7 | ||
│ | ||
14 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:17:7 | ||
│ | ||
17 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:22:3 | ||
│ | ||
22 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:24:7 | ||
│ | ||
24 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:27:7 | ||
│ | ||
27 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:31:3 | ||
│ | ||
31 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:33:7 | ||
│ | ||
33 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:36:7 | ||
│ | ||
36 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:39:7 | ||
│ | ||
39 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_placement.move:44:7 | ||
│ | ||
44 │ #[attr] | ||
│ ^^^^ Attribute name 'attr' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
60 changes: 60 additions & 0 deletions
60
third_party/move/move-compiler/tests/move_check/parser/attribute_variants.exp
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_variants.move:2:3 | ||
│ | ||
2 │ #[attr0] | ||
│ ^^^^^ Attribute name 'attr0' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_variants.move:3:3 | ||
│ | ||
3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] | ||
│ ^^^^^ Attribute name 'attr1' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_variants.move:3:12 | ||
│ | ||
3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] | ||
│ ^^^^^ Attribute name 'attr2' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_variants.move:3:28 | ||
│ | ||
3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] | ||
│ ^^^^^ Attribute name 'attr3' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_variants.move:3:41 | ||
│ | ||
3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] | ||
│ ^^^^^ Attribute name 'attr4' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_variants.move:3:53 | ||
│ | ||
3 │ #[attr1=0, attr2=b"hello", attr3=x"0f", attr4=0x42, attr5(attr0, attr1, attr2(attr0, attr1=0))] | ||
│ ^^^^^ Attribute name 'attr5' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_variants.move:4:3 | ||
│ | ||
4 │ #[bttr0=false, bttr1=0u8, bttr2=0u64, bttr3=0u128] | ||
│ ^^^^^ Attribute name 'bttr0' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_variants.move:4:16 | ||
│ | ||
4 │ #[bttr0=false, bttr1=0u8, bttr2=0u64, bttr3=0u128] | ||
│ ^^^^^ Attribute name 'bttr1' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_variants.move:4:27 | ||
│ | ||
4 │ #[bttr0=false, bttr1=0u8, bttr2=0u64, bttr3=0u128] | ||
│ ^^^^^ Attribute name 'bttr2' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/attribute_variants.move:4:39 | ||
│ | ||
4 │ #[bttr0=false, bttr1=0u8, bttr2=0u64, bttr3=0u128] | ||
│ ^^^^^ Attribute name 'bttr3' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
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
12 changes: 12 additions & 0 deletions
12
third_party/move/move-compiler/tests/move_check/parser/testonly.exp
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/testonly.move:5:7 | ||
│ | ||
5 │ #[testonly] | ||
│ ^^^^^^^^ Attribute name 'testonly' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
||
warning[W02016]: unknown attribute | ||
┌─ tests/move_check/parser/testonly.move:15:7 | ||
│ | ||
15 │ #[view] | ||
│ ^^^^ Attribute name 'view' is unknown (use --skip-attribute-checks CLI option to ignore); known attributes are '{"bytecode_instruction", "deprecated", "expected_failure", "native_interface", "test", "test_only", "verify_only"}'. | ||
|
19 changes: 19 additions & 0 deletions
19
third_party/move/move-compiler/tests/move_check/parser/testonly.move
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module 0x1::A { | ||
#[test] | ||
fun a() { } | ||
|
||
#[testonly] | ||
public fun a_call() { | ||
abort 0 | ||
} | ||
|
||
#[test_only] | ||
public fun b_call() { | ||
abort 0 | ||
} | ||
|
||
#[view] | ||
public fun c_call() { | ||
abort 0 | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...ove/move-compiler/tests/move_check/skip_attribute_checks/attribute_no_closing_bracket.exp
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error[E01002]: unexpected token | ||
┌─ tests/move_check/skip_attribute_checks/attribute_no_closing_bracket.move:4:5 | ||
│ | ||
3 │ #[attr = 0 | ||
│ - To match this '[' | ||
4 │ fun foo() {} | ||
│ ^ Expected ']' | ||
|
5 changes: 5 additions & 0 deletions
5
...ve/move-compiler/tests/move_check/skip_attribute_checks/attribute_no_closing_bracket.move
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module 0x42::M { | ||
// Errors expecting a ']' | ||
#[attr = 0 | ||
fun foo() {} | ||
} |
Oops, something went wrong.