layout/tests: Add post option update to randomized test

Will help to catch cases where updating options doesn't update the state
correctly.
This commit is contained in:
Ivan Molodetskikh
2024-11-26 21:54:51 +03:00
parent fa4aa0e06d
commit 4c480a1ea3
+11 -2
View File
@@ -6005,9 +6005,18 @@ mod tests {
})]
#[test]
fn random_operations_dont_panic(ops: Vec<Op>, options in arbitrary_options()) {
fn random_operations_dont_panic(
ops: Vec<Op>,
options in arbitrary_options(),
post_options in prop::option::of(arbitrary_options()),
) {
// eprintln!("{ops:?}");
check_ops_with_options(options, &ops);
let mut layout = check_ops_with_options(options, &ops);
if let Some(post_options) = post_options {
layout.update_options(post_options);
layout.verify_invariants();
}
}
}
}