prop_assume!(a != b) in some tests to fix spurious failures

This commit is contained in:
Phoebe Goldman
2025-02-03 10:07:28 -05:00
parent d839657008
commit 3d384dc202
2 changed files with 6 additions and 0 deletions
@@ -5,3 +5,4 @@
# It is recommended to check this file in to source control so that
# everyone who runs the test benefits from these saved cases.
cc 9d74a36309d35ba5b09bd33cbc24f72f95a498152b469caeeeb8c2adf712974c # shrinks to (size, [ptr_a, ptr_b]) = (Size(2), [RowPointer(r: 0, pi: 0, po: 0, so: 1), RowPointer(r: 0, pi: 0, po: 0, so: 1)])
cc daf4d4880192b4f6d95f928ed49d80465b48ff4fde4ae31aea5cfea3996cdbc6 # shrinks to minimal failing input: (size, [ptr_a, ptr_b]) = (Size(23), [RowPointer(r: 0, pi: 75, po: 828, so: 1), RowPointer(r: 0, pi: 75, po: 828, so: 1)])
@@ -239,6 +239,8 @@ mod test {
proptest! {
#[test]
fn insertion_entails_contained((size, [ptr_a, ptr_b]) in gen_size_and_ptrs()) {
prop_assume!(ptr_a != ptr_b);
let mut dt = TestDT::new(size);
// Initially we have nothing.
@@ -266,7 +268,10 @@ mod test {
#[test]
fn deleting_non_existent_does_nothing((size, [ptr_a, ptr_b]) in gen_size_and_ptrs()) {
prop_assume!(ptr_a != ptr_b);
let mut dt = TestDT::new(size);
prop_assert!(!dt.remove(ptr_b));
prop_assert!(dt.insert(ptr_a));
prop_assert!(!dt.remove(ptr_b));