-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only verified by metadata when the field of the struct is in another …
…module. add the data_struct_func tests add more tests for data_struct_func add more tests add tests for special allowed types add more mvir tests add the missed exp file
- Loading branch information
1 parent
0947402
commit 0113d16
Showing
53 changed files
with
793 additions
and
3 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...ts/tests/cases/mvir_tests/data_struct/data_struct_invalid_current_module_struct_field.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-12: | ||
status ABORTED with code 10014 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
12 changes: 12 additions & 0 deletions
12
...s/tests/cases/mvir_tests/data_struct/data_struct_invalid_current_module_struct_field.mvir
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 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
struct S0<T> has copy, drop {x: T} | ||
// error code 10014: INVALID_DATA_STRUCT_NOT_ALLOWED_TYPE | ||
struct S1 has drop,copy {v: Self.S0<u32>} | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S1 -> true; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
..._tests/data_struct/data_struct_invalid_move_std_option_option_as_field_current_module.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-13: | ||
status ABORTED with code 10014 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
13 changes: 13 additions & 0 deletions
13
...tests/data_struct/data_struct_invalid_move_std_option_option_as_field_current_module.mvir
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,13 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
import 0x1.option; | ||
struct S0<T> has copy, drop {x: T} | ||
// error code 10014: INVALID_DATA_STRUCT_NOT_ALLOWED_TYPE | ||
struct S1 has copy,drop {v: option.Option<Self.S0<u32>>} | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S1 -> true; | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...ests/tests/cases/mvir_tests/data_struct/data_struct_invalid_other_module_struct_field.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,7 @@ | ||
processed 2 tasks | ||
|
||
task 0 'publish'. lines 1-4: | ||
status EXECUTED | ||
|
||
task 1 'publish'. lines 6-18: | ||
status ABORTED with code 10015 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
18 changes: 18 additions & 0 deletions
18
...sts/tests/cases/mvir_tests/data_struct/data_struct_invalid_other_module_struct_field.mvir
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,18 @@ | ||
//# publish | ||
module 0x1.TestModule0 { | ||
struct S0 has drop,copy { x: address } | ||
} | ||
|
||
//# publish | ||
module 0x1.TestModule1 { | ||
import 0x1.TestModule0; | ||
|
||
// error code 10015: INVALID_DATA_STRUCT_NOT_IN_MODULE_METADATA | ||
struct S0 has drop,copy {v: TestModule0.S0} | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S0 -> true; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...s/tests/cases/mvir_tests/data_struct/data_struct_valid_move_std_ascii_string_as_field.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-11: | ||
status EXECUTED |
11 changes: 11 additions & 0 deletions
11
.../tests/cases/mvir_tests/data_struct/data_struct_valid_move_std_ascii_string_as_field.mvir
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,11 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
import 0x1.ascii; | ||
struct S0 has copy,drop {v: ascii.String} | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S0 -> true; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
.../tests/cases/mvir_tests/data_struct/data_struct_valid_move_std_option_option_as_field.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-11: | ||
status EXECUTED |
11 changes: 11 additions & 0 deletions
11
...tests/cases/mvir_tests/data_struct/data_struct_valid_move_std_option_option_as_field.mvir
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,11 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
import 0x1.option; | ||
struct S0 has copy,drop {v: option.Option<u32>} | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S0 -> true; | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...mvir_tests/data_struct/data_struct_valid_move_std_option_option_as_field_other_module.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,7 @@ | ||
processed 2 tasks | ||
|
||
task 0 'publish'. lines 1-10: | ||
status EXECUTED | ||
|
||
task 1 'publish'. lines 12-24: | ||
status EXECUTED |
24 changes: 24 additions & 0 deletions
24
...vir_tests/data_struct/data_struct_valid_move_std_option_option_as_field_other_module.mvir
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,24 @@ | ||
//# publish | ||
module 0x123.TestModule0 { | ||
struct S0 has copy, drop {x: u32} | ||
|
||
metadata { | ||
data_struct { | ||
0x123::TestModule0::S0 -> true; | ||
} | ||
} | ||
} | ||
|
||
//# publish | ||
module 0x1.TestModule1 { | ||
import 0x123.TestModule0; | ||
import 0x1.option; | ||
|
||
struct S1 has copy,drop {v: option.Option<TestModule0.S0>} | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S1 -> true; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
.../tests/cases/mvir_tests/data_struct/data_struct_valid_move_std_string_string_as_field.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-11: | ||
status EXECUTED |
11 changes: 11 additions & 0 deletions
11
...tests/cases/mvir_tests/data_struct/data_struct_valid_move_std_string_string_as_field.mvir
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,11 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
import 0x1.string; | ||
struct S0 has copy,drop {v: string.String} | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S0 -> true; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...ts/cases/mvir_tests/data_struct/data_struct_valid_moveos_std_object_objectid_as_field.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-11: | ||
status EXECUTED |
11 changes: 11 additions & 0 deletions
11
...s/cases/mvir_tests/data_struct/data_struct_valid_moveos_std_object_objectid_as_field.mvir
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,11 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
import 0x2.object; | ||
struct S0 has copy,drop {v: object.ObjectID} | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S0 -> true; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...work-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_struct_current_module.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-10: | ||
status EXECUTED |
10 changes: 10 additions & 0 deletions
10
...ork-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_struct_current_module.mvir
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,10 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
struct S0 has copy,drop {v: u64} | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S0 -> true; | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...mework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_struct_other_module.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,7 @@ | ||
processed 2 tasks | ||
|
||
task 0 'publish'. lines 1-10: | ||
status EXECUTED | ||
|
||
task 1 'publish'. lines 12-23: | ||
status EXECUTED |
23 changes: 23 additions & 0 deletions
23
...ework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_struct_other_module.mvir
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,23 @@ | ||
//# publish | ||
module 0x1.TestModule0 { | ||
struct S0 has copy,drop {v: u64} | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule0::S0 -> true; | ||
} | ||
} | ||
} | ||
|
||
//# publish | ||
module 0x1.TestModule1 { | ||
import 0x1.TestModule0; | ||
|
||
struct S0 has copy,drop {v: TestModule0.S0} | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S0 -> true; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...rk-tests/tests/cases/mvir_tests/data_struct_func/data_struct_func_function_not_exists.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-14: | ||
status ABORTED with code 10001 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
14 changes: 14 additions & 0 deletions
14
...k-tests/tests/cases/mvir_tests/data_struct_func/data_struct_func_function_not_exists.mvir
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,14 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
metadata { | ||
data_struct_func { | ||
// error code 10001: FUNCTION_NOT_EXITS | ||
0x1::TestModule1::f111 -> true; | ||
} | ||
} | ||
|
||
public f1() { | ||
label b0: | ||
return; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...s/mvir_tests/data_struct_func/data_struct_func_invalid_call_syslib_now_allowed_struct.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-22: | ||
status ABORTED with code 10008 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
22 changes: 22 additions & 0 deletions
22
.../mvir_tests/data_struct_func/data_struct_func_invalid_call_syslib_now_allowed_struct.mvir
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,22 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
import 0x2.bcs; | ||
import 0x1.vector; | ||
|
||
struct S0 has copy,drop { x: u64 } | ||
|
||
metadata { | ||
data_struct { | ||
// 0x1::TestModule1::S0 -> true; | ||
} | ||
} | ||
|
||
public f2() { | ||
let s1: vector<u8>; | ||
label b0: | ||
s1 = vector.empty<u8>(); | ||
// error code 10008: INVALID_DATA_STRUCT | ||
_ = bcs.from_bytes<Self.S0>(move(s1)); | ||
return; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...k-tests/tests/cases/mvir_tests/data_struct_func/data_struct_func_invalid_module_owner.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-9: | ||
status ABORTED with code 10010 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
9 changes: 9 additions & 0 deletions
9
...-tests/tests/cases/mvir_tests/data_struct_func/data_struct_func_invalid_module_owner.mvir
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,9 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
metadata { | ||
data_struct_func { | ||
// error code 10010: INVALID_MODULE_OWNER | ||
0x123::SomeModule::f1 -> [0, 1]; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...mvir_tests/data_struct_func/data_struct_func_invalid_move_std_option_option_as_struct.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-39: | ||
status ABORTED with code 10009 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
39 changes: 39 additions & 0 deletions
39
...vir_tests/data_struct_func/data_struct_func_invalid_move_std_option_option_as_struct.mvir
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,39 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
import 0x1.option; | ||
import 0x1.vector; | ||
struct S0 has copy,drop { x: u64 } | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S0 -> true; | ||
} | ||
data_struct_func { | ||
0x1::TestModule1::f1 -> [0, 1]; | ||
} | ||
} | ||
|
||
public new(): Self.S0 { | ||
label b0: | ||
return S0{ x: 123 }; | ||
} | ||
|
||
public f1<T1: drop, T2: drop>(arg1: T1, arg2: T2) { | ||
label b0: | ||
_ = move(arg1); | ||
_ = move(arg2); | ||
return; | ||
} | ||
|
||
public f2() { | ||
let s0: Self.S0; | ||
let s1: option.Option<u32>; | ||
|
||
label b0: | ||
s0 = Self.new(); | ||
s1 = option.some<u32>(123u32); | ||
// error code 10009: INVALID_DATA_STRUCT_TYPE | ||
Self.f1<Self.S0, option.Option<u32>>(move(s0), move(s1)); | ||
return; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...mvir_tests/data_struct_func/data_struct_func_invalid_type_parameter_in_current_module.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-34: | ||
status ABORTED with code 10009 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
34 changes: 34 additions & 0 deletions
34
...vir_tests/data_struct_func/data_struct_func_invalid_type_parameter_in_current_module.mvir
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,34 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
struct S0 has copy,drop { x: u64 } | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S0 -> true; | ||
} | ||
data_struct_func { | ||
0x1::TestModule1::f1 -> [0, 1]; | ||
} | ||
} | ||
|
||
public new(): Self.S0 { | ||
label b0: | ||
return S0{ x: 123 }; | ||
} | ||
|
||
public f1<T1: drop, T2: drop>(arg1: T1, arg2: T2) { | ||
label b0: | ||
_ = move(arg1); | ||
_ = move(arg2); | ||
return; | ||
} | ||
|
||
public f2<T: drop+copy>(arg: T) { | ||
let s0: Self.S0; | ||
label b0: | ||
s0 = Self.new(); | ||
// error code 10009: INVALID_DATA_STRUCT_TYPE | ||
Self.f1<Self.S0, T>(move(s0), copy(arg)); | ||
return; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...s/mvir_tests/data_struct_func/data_struct_func_invalid_type_parameter_in_other_module.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,7 @@ | ||
processed 2 tasks | ||
|
||
task 0 'publish'. lines 1-15: | ||
status EXECUTED | ||
|
||
task 1 'publish'. lines 17-41: | ||
status ABORTED with code 10009 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
Oops, something went wrong.