mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
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:
+11
-2
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user