forked from MystenLabs/sui
-
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.
[verifier] Migrate struct_with_key tests (MystenLabs#1991)
- Migrated to expected output tests
- Loading branch information
Showing
22 changed files
with
152 additions
and
171 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
name = "sui-adapter-transactional-tests" | ||
version = "0.1.0" | ||
authors = ["Mysten Labs <[email protected]>"] | ||
description = "Adapter and accompanying CLI for local sui development" | ||
description = "Transactional tests for Sui Adapter" | ||
license = "Apache-2.0" | ||
publish = false | ||
edition = "2021" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "sui-verifier-transactional-tests" | ||
version = "0.1.0" | ||
authors = ["Mysten Labs <[email protected]>"] | ||
description = "Transactional tests for Sui Verifier" | ||
license = "Apache-2.0" | ||
publish = false | ||
edition = "2021" | ||
|
||
[dev-dependencies] | ||
datatest-stable = "0.1.1" | ||
sui-transactional-test-runner = { path = "../sui-transactional-test-runner" } | ||
|
||
[[test]] | ||
name = "tests" | ||
harness = false |
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,6 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#![forbid(unsafe_code)] | ||
|
||
// Empty src/lib.rs to get rusty-tags working. |
4 changes: 4 additions & 0 deletions
4
.../sui-verifier-transactional-tests/tests/struct_with_key/key_struct_first_field_not_id.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 4-10: | ||
Error: Failed to verify the Move module, reason: "First field of struct S must be 'id', flag found". |
10 changes: 10 additions & 0 deletions
10
...sui-verifier-transactional-tests/tests/struct_with_key/key_struct_first_field_not_id.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 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
struct S has key { | ||
flag: bool | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...ransactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_struct_address.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 4-11: | ||
Error: Failed to verify the Move module, reason: "First field of struct S must be of type Sui::ID::VersionedID, _::ID::VersionedID type found". |
11 changes: 11 additions & 0 deletions
11
...ansactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_struct_address.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 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.ID { | ||
import 0x2.ID; | ||
struct VersionedID has store { flag: bool } | ||
struct S has key { | ||
id: Self.VersionedID | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...r-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_struct_name.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 4-10: | ||
Error: Failed to verify the Move module, reason: "First field of struct S must be of type Sui::ID::VersionedID, Sui::ID::ID type found". |
10 changes: 10 additions & 0 deletions
10
...-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_struct_name.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 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
struct S has key { | ||
id: ID.ID | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_type.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 4-10: | ||
Error: Failed to verify the Move module, reason: "First field of struct S must be of ID type, Bool type found". |
10 changes: 10 additions & 0 deletions
10
...erifier-transactional-tests/tests/struct_with_key/key_struct_id_field_incorrect_type.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 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
struct S has key { | ||
id: bool | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_valid.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,5 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 4-10: | ||
created: object(103) | ||
written: object(102) |
10 changes: 10 additions & 0 deletions
10
crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_id_field_valid.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 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
struct S has key { | ||
id: ID.VersionedID | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_second_field_id.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 4-11: | ||
Error: Failed to verify the Move module, reason: "First field of struct S must be 'id', flag found". |
11 changes: 11 additions & 0 deletions
11
...es/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_second_field_id.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 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
struct S has key { | ||
flag: bool, | ||
id: ID.VersionedID, | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_with_drop.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 4-10: | ||
Error: Failed to verify the Move module, reason: "Struct S cannot have both key and drop abilities". |
10 changes: 10 additions & 0 deletions
10
crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_with_drop.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 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
struct S has key, drop { | ||
flag: bool | ||
} | ||
} |
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 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
pub const TEST_DIR: &str = "tests"; | ||
use sui_transactional_test_runner::run_test; | ||
|
||
datatest_stable::harness!(run_test, TEST_DIR, r".*\.(mvir|move)$"); |
156 changes: 0 additions & 156 deletions
156
crates/sui-verifier/tests/struct_with_key_verification_test.rs
This file was deleted.
Oops, something went wrong.