Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudgolfouse committed Dec 10, 2024
1 parent c66f258 commit e2144a8
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 0 deletions.
70 changes: 70 additions & 0 deletions creusot/tests/should_succeed/mapping_indexing.coma

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

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

pub fn foo() {
let mut mapping = snapshot!(Mapping::unknown());

mapping = snapshot!(mapping.set(0, 2));
proof_assert!(mapping[0] == 2);
mapping = snapshot!(mapping.set(1, 3));
proof_assert!(mapping[0] == 2);
proof_assert!(mapping[1] == 3);
mapping = snapshot!(mapping.set(0, 4));
proof_assert!(mapping[1] == 3);
proof_assert!(mapping[0] == 4);
}
14 changes: 14 additions & 0 deletions creusot/tests/should_succeed/mapping_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 e2144a8

Please sign in to comment.