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 Jun 30, 2024
1 parent e3b2241 commit 63773cd
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 63773cd

Please sign in to comment.