From 7c5fb7de389378e20ea60fafe42b1d0646a33570 Mon Sep 17 00:00:00 2001 From: DemchaAV Date: Fri, 10 Jul 2026 09:16:13 +0100 Subject: [PATCH] test(layout): add jqwik property-based layout invariants Add the jqwik test dependency (test scope only) and property tests for three pure layout functions: TokenBreaking.softBreakSegments (split then re-join reconstructs the token, no empty segment), LayerStackGeometry.zOrder (a stable permutation of the source indices, ascending by zIndex), and RowSlots.validateWeightsMatchChildren (throws exactly when the weight count differs from the child count). Each law is checked over 1000 generated inputs, complementing the example-based unit tests. --- .gitignore | 3 + pom.xml | 13 +++ .../LayoutInvariantsPropertiesTest.java | 90 +++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 src/test/java/com/demcha/compose/document/layout/LayoutInvariantsPropertiesTest.java diff --git a/.gitignore b/.gitignore index 69188cc9..a06a2440 100644 --- a/.gitignore +++ b/.gitignore @@ -82,3 +82,6 @@ docs/private/ # test fails, useful for review locally, not part of repo state. **/visual-baselines/**/*.actual.png **/visual-baselines/**/*.diff.png + +# jqwik property-based test replay database — regenerated on every run. +.jqwik-database diff --git a/pom.xml b/pom.xml index dd8ca314..2746963b 100644 --- a/pom.xml +++ b/pom.xml @@ -57,6 +57,7 @@ 5.23.0 1.18.11 1.4.2 + 1.9.3 + + net.jqwik + jqwik + ${jqwik.version} + test + +