From 4c480a1ea3280733bc428d9cb38150bfc1a7c36c Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 26 Nov 2024 21:54:51 +0300 Subject: layout/tests: Add post option update to randomized test Will help to catch cases where updating options doesn't update the state correctly. --- src/layout/mod.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/layout') diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 2da081bf..cf61e87a 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -6005,9 +6005,18 @@ mod tests { })] #[test] - fn random_operations_dont_panic(ops: Vec, options in arbitrary_options()) { + fn random_operations_dont_panic( + ops: Vec, + 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(); + } } } } -- cgit