-
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.
- Loading branch information
1 parent
7ed21a1
commit a876ce9
Showing
8 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
third_party/move/move-compiler-v2/tests/more-v1/verification/noverify/function_with_spec.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,13 @@ | ||
|
||
Diagnostics: | ||
error: unresolved spec target | ||
┌─ tests/more-v1/verification/noverify/function_with_spec.move:10:10 | ||
│ | ||
10 │ spec bar { | ||
│ ^^^ | ||
|
||
error: unresolved spec target | ||
┌─ tests/more-v1/verification/noverify/function_with_spec.move:15:10 | ||
│ | ||
15 │ spec baz { | ||
│ ^^^ |
19 changes: 19 additions & 0 deletions
19
...d_party/move/move-compiler-v2/tests/more-v1/verification/noverify/function_with_spec.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 @@ | ||
// #[test_only] functions should be filtered out in non-test mode | ||
address 0x1234 { | ||
module M { | ||
public fun foo() { } | ||
|
||
#[verify_only] | ||
public fun bar() { } | ||
|
||
// This should not cause an error in either test- nor non-test-mode. | ||
spec bar { | ||
aborts_if false; | ||
} | ||
|
||
// This should always cause an error due to typo. | ||
spec baz { | ||
aborts_if false; | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
third_party/move/move-compiler-v2/tests/more-v1/verification/verify/function_with_spec.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,10 @@ | ||
|
||
Diagnostics: | ||
error: unresolved spec target | ||
┌─ tests/more-v1/verification/verify/function_with_spec.move:15:10 | ||
│ | ||
15 │ spec baz { | ||
│ ^^^ | ||
|
||
|
||
============ bytecode verification succeeded ======== |
19 changes: 19 additions & 0 deletions
19
third_party/move/move-compiler-v2/tests/more-v1/verification/verify/function_with_spec.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 @@ | ||
// #[test_only] functions should be filtered out in non-test mode | ||
address 0x1234 { | ||
module M { | ||
public fun foo() { } | ||
|
||
#[verify_only] | ||
public fun bar() { } | ||
|
||
// This should not cause an error in either test- nor non-test-mode. | ||
spec bar { | ||
aborts_if false; | ||
} | ||
|
||
// This should always cause an error due to typo. | ||
spec baz { | ||
aborts_if false; | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
third_party/move/move-compiler-v2/tests/unit_test/notest/function_with_spec.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,13 @@ | ||
|
||
Diagnostics: | ||
error: unresolved spec target | ||
┌─ tests/unit_test/notest/function_with_spec.move:13:10 | ||
│ | ||
13 │ spec bar { | ||
│ ^^^ | ||
|
||
error: unresolved spec target | ||
┌─ tests/unit_test/notest/function_with_spec.move:18:10 | ||
│ | ||
18 │ spec baz { | ||
│ ^^^ |
22 changes: 22 additions & 0 deletions
22
third_party/move/move-compiler-v2/tests/unit_test/notest/function_with_spec.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,22 @@ | ||
// #[test_only] functions should be filtered out in non-test mode | ||
address 0x1234 { | ||
module M { | ||
public fun foo() { } | ||
|
||
#[test] | ||
public fun bar_test() { bar() } | ||
|
||
#[test_only] | ||
public fun bar() { } | ||
|
||
// This should not cause an error in either test- nor non-test-mode. | ||
spec bar { | ||
aborts_if false; | ||
} | ||
|
||
// This should always cause an error due to typo. | ||
spec baz { | ||
aborts_if false; | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
third_party/move/move-compiler-v2/tests/unit_test/test/function_with_spec.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,10 @@ | ||
|
||
Diagnostics: | ||
error: unresolved spec target | ||
┌─ tests/unit_test/test/function_with_spec.move:18:10 | ||
│ | ||
18 │ spec baz { | ||
│ ^^^ | ||
|
||
|
||
============ bytecode verification succeeded ======== |
22 changes: 22 additions & 0 deletions
22
third_party/move/move-compiler-v2/tests/unit_test/test/function_with_spec.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,22 @@ | ||
// #[test_only] functions should be filtered out in non-test mode | ||
address 0x1234 { | ||
module M { | ||
public fun foo() { } | ||
|
||
#[test] | ||
public fun bar_test() { bar() } | ||
|
||
#[test_only] | ||
public fun bar() { } | ||
|
||
// This should not cause an error in either test- nor non-test-mode. | ||
spec bar { | ||
aborts_if false; | ||
} | ||
|
||
// This should always cause an error due to typo. | ||
spec baz { | ||
aborts_if false; | ||
} | ||
} | ||
} |