Skip to content

Commit

Permalink
add tests for #13737
Browse files Browse the repository at this point in the history
  • Loading branch information
brmataptos committed Jul 11, 2024
1 parent 5c84127 commit ea031cb
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
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 {
│ ^^^
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;
}
}
}
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 ========
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;
}
}
}

0 comments on commit ea031cb

Please sign in to comment.