diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-12-29 11:43:16 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-12-29 11:43:16 +0400 |
| commit | 46d5f5ec4d039e0883832cd45d08cb03f43840d8 (patch) | |
| tree | f12217195f4f6fb391fc8b256b2bdc03ad1d0d66 /src | |
| parent | c64e96d0d8c4b347549b3b6f08e1b6e54b680104 (diff) | |
| download | niri-46d5f5ec4d039e0883832cd45d08cb03f43840d8.tar.gz niri-46d5f5ec4d039e0883832cd45d08cb03f43840d8.tar.bz2 niri-46d5f5ec4d039e0883832cd45d08cb03f43840d8.zip | |
Add randomized border to proptest
Diffstat (limited to 'src')
| -rw-r--r-- | src/layout/mod.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 07e216e2..9c3fb66b 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -2186,6 +2186,10 @@ mod tests { check_ops_with_options(options, &ops); } + fn arbitrary_border() -> impl Strategy<Value = u16> { + prop_oneof![Just(0), (1..=u16::MAX)] + } + proptest! { #![proptest_config(ProptestConfig { cases: if std::env::var_os("RUN_SLOW_TESTS").is_none() { @@ -2198,9 +2202,15 @@ mod tests { })] #[test] - fn random_operations_dont_panic(ops: Vec<Op>) { + fn random_operations_dont_panic(ops: Vec<Op>, border in arbitrary_border()) { + let mut options = Options::default(); + if border != 0 { + options.border.off = false; + options.border.width = border; + } + // eprintln!("{ops:?}"); - check_ops(&ops); + check_ops_with_options(options, &ops); } } } |
