aboutsummaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/mod.rs17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index 21e90668..97a839c1 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -4271,12 +4271,21 @@ mod tests {
prop_oneof![Just(0.), Just(4.), ((1.)..=65535.)]
}
+ fn arbitrary_spacing_neg() -> impl Strategy<Value = f64> {
+ // Give equal weight to:
+ // - 0: the element is disabled
+ // - 4: some reasonable value
+ // - -4: some reasonable negative value
+ // - random value, likely unreasonably big
+ prop_oneof![Just(0.), Just(4.), Just(-4.), ((1.)..=65535.)]
+ }
+
fn arbitrary_struts() -> impl Strategy<Value = Struts> {
(
- arbitrary_spacing(),
- arbitrary_spacing(),
- arbitrary_spacing(),
- arbitrary_spacing(),
+ arbitrary_spacing_neg(),
+ arbitrary_spacing_neg(),
+ arbitrary_spacing_neg(),
+ arbitrary_spacing_neg(),
)
.prop_map(|(left, right, top, bottom)| Struts {
left: FloatOrInt(left),