Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudgolfouse committed Nov 28, 2024
1 parent d14b7d8 commit 21f5931
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 5 deletions.
10 changes: 5 additions & 5 deletions creusot/tests/creusot-contracts/creusot-contracts.coma

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions creusot/tests/should_succeed/ghost/snapshot_in_ghost.coma

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions creusot/tests/should_succeed/ghost/snapshot_in_ghost.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
extern crate creusot_contracts;
use creusot_contracts::*;

// Check that we can make snapshots in ghost code.
pub fn foo() {
ghost! {
let x = snapshot!(1);
proof_assert!(*x == 1);
};
}

// Check that we can make snapshots in pure functions.
#[pure]
pub fn is_pure() {
let x = snapshot!(1);
proof_assert!(*x == 1);
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

0 comments on commit 21f5931

Please sign in to comment.