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 27, 2024
1 parent 81d5434 commit 05b4792
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 0 deletions.
130 changes: 130 additions & 0 deletions creusot/tests/should_succeed/fmap_indexing.coma

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

12 changes: 12 additions & 0 deletions creusot/tests/should_succeed/fmap_indexing.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extern crate creusot_contracts;
use creusot_contracts::{logic::FMap, *};

pub fn foo() {
let mut map = snapshot!(FMap::empty());
map = snapshot!(map.insert(1, 3));
proof_assert!(map[1] == 3);
map = snapshot!(map.insert(2, 42));
proof_assert!(map[1] == 3 && map[2] == 42);
map = snapshot!(map.insert(1, 4));
proof_assert!(map[1] == 4 && map[2] == 42);
}
14 changes: 14 additions & 0 deletions creusot/tests/should_succeed/fmap_indexing/why3session.xml

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 05b4792

Please sign in to comment.