test: add mac coverage helpers

This commit is contained in:
Peter Steinberger
2025-12-24 19:29:44 +01:00
parent f44014ff00
commit 204bd7d2c4
11 changed files with 632 additions and 71 deletions

View File

@@ -17,3 +17,13 @@ extension View {
.onPreferenceChange(ViewWidthPreferenceKey.self, perform: onChange)
}
}
#if DEBUG
enum ViewMetricsTesting {
static func reduceWidth(current: CGFloat, next: CGFloat) -> CGFloat {
var value = current
ViewWidthPreferenceKey.reduce(value: &value, nextValue: { next })
return value
}
}
#endif