forge
Explore
Log in

Don't you dare go Hollow

layout/tests: Add post option update to randomized test

Browse files at this commit

4c480a1ea3280733bc428d9cb38150bfc1a7c36cIvan MolodetskikhParent: fa4aa0e
Will help to catch cases where updating options doesn't update the state
correctly.
src/layout/mod.rsmodified+11 -2
@@ -6005,9 +6005,18 @@ mod tests {
6005 })]6005 })]
6006 6006
6007 #[test]6007 #[test]
6008- fn random_operations_dont_panic(ops: Vec<Op>, options in arbitrary_options()) {6008+ fn random_operations_dont_panic(
6009+ ops: Vec<Op>,
6010+ options in arbitrary_options(),
6011+ post_options in prop::option::of(arbitrary_options()),
6012+ ) {
6009 // eprintln!("{ops:?}");6013 // eprintln!("{ops:?}");
6010- check_ops_with_options(options, &ops);6014+ let mut layout = check_ops_with_options(options, &ops);
6015+
6016+ if let Some(post_options) = post_options {
6017+ layout.update_options(post_options);
6018+ layout.verify_invariants();
6019+ }
6011 }6020 }
6012 }6021 }
6013 }6022 }