aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-11-26 21:54:51 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-11-26 22:02:46 +0300
commit4c480a1ea3280733bc428d9cb38150bfc1a7c36c (patch)
tree08b56439348e58f8eae6116eff5087043e921c0f
parentfa4aa0e06ddd2d87b918e6ecaaf2b3c466fa9a30 (diff)
downloadniri-4c480a1ea3280733bc428d9cb38150bfc1a7c36c.tar.gz
niri-4c480a1ea3280733bc428d9cb38150bfc1a7c36c.tar.bz2
niri-4c480a1ea3280733bc428d9cb38150bfc1a7c36c.zip
layout/tests: Add post option update to randomized test
Will help to catch cases where updating options doesn't update the state correctly.
-rw-r--r--src/layout/mod.rs13
1 files changed, 11 insertions, 2 deletions
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<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();
+ }
}
}
}