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 id_immutable tests (MystenLabs#2015)
- Migrated to expected output tests
- Loading branch information
Showing
9 changed files
with
91 additions
and
158 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...l-tests/transactional-tests/tests/id_immutable/mut_borrow_generic_key_struct_id_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 4-18: | ||
Error: Failed to verify the Move module, reason: "In function foo: ID field of struct Foo cannot be mut borrowed because ID is immutable.". |
18 changes: 18 additions & 0 deletions
18
...-tests/transactional-tests/tests/id_immutable/mut_borrow_generic_key_struct_id_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 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
|
||
struct Foo<T> has key { | ||
id: ID.VersionedID, | ||
} | ||
|
||
foo(f: Self.Foo<u64>) { | ||
label l0: | ||
_ = &mut (&mut f).Foo<u64>::id; | ||
abort 0; | ||
} | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...sactional-tests/transactional-tests/tests/id_immutable/mut_borrow_key_struct_id_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 4-18: | ||
Error: Failed to verify the Move module, reason: "In function foo: ID field of struct Foo cannot be mut borrowed because ID is immutable.". |
18 changes: 18 additions & 0 deletions
18
...actional-tests/transactional-tests/tests/id_immutable/mut_borrow_key_struct_id_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 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
|
||
struct Foo has key { | ||
id: ID.VersionedID, | ||
} | ||
|
||
foo(f: Self.Foo) { | ||
label l0: | ||
_ = &mut (&mut f).Foo::id; | ||
abort 0; | ||
} | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
...ional-tests/transactional-tests/tests/id_immutable/mut_borrow_key_struct_non_id_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,5 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 4-19: | ||
created: object(103) | ||
written: object(102) |
19 changes: 19 additions & 0 deletions
19
...onal-tests/transactional-tests/tests/id_immutable/mut_borrow_key_struct_non_id_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,19 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
|
||
struct Foo has key { | ||
id: ID.VersionedID, | ||
other: ID.VersionedID, | ||
} | ||
|
||
foo(f: Self.Foo) { | ||
label l0: | ||
_ = &mut (&mut f).Foo::other; | ||
abort 0; | ||
} | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
...ional-tests/transactional-tests/tests/id_immutable/mut_borrow_non_key_struct_id_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,5 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 4-18: | ||
created: object(103) | ||
written: object(102) |
18 changes: 18 additions & 0 deletions
18
...onal-tests/transactional-tests/tests/id_immutable/mut_borrow_non_key_struct_id_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 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
|
||
struct Foo { | ||
id: ID.VersionedID, | ||
} | ||
|
||
foo(f: Self.Foo) { | ||
label l0: | ||
_ = &mut (&mut f).Foo::id; | ||
abort 0; | ||
} | ||
|
||
} |
158 changes: 0 additions & 158 deletions
158
crates/sui-verifier/tests/id_immutable_verification_test.rs
This file was deleted.
Oops, something went wrong.