Skip to content

Commit b740a7d

Browse files
authored
docs(test): state test invariants directly instead of citing internal plan refs (#233)
Why: several merged test files referenced internal planning identifiers and a gitignored planning-doc path in their comments and Javadoc. A public reader of the repo cannot resolve those references, so they read as noise rather than documentation. What: reword the affected comments/Javadoc to describe the invariant or behaviour each test guards, directly: - InlineHighlightRenderTest: the chip-is-one-atomic-token invariant and the over-wide-chip-emitted-on-its-own-line behaviour. - cv + coverletter PresetVisualParityTest: the pixel-diff parity gate now points at its in-source PIXEL_DIFF_BUDGET / PER_PIXEL_TOLERANCE constants, also dropping a stale figure that contradicted them. - VersionConsistencyGuardTest: the version-literal drift class it guards. CanonicalSurfaceGuardTest is intentionally left unchanged — excluding the gitignored planning directory is the behaviour under test there. Tests: ./mvnw test -Dtest=InlineHighlightRenderTest,PresetVisualParityTest,VersionConsistencyGuardTest -pl . (49 passed); ./mvnw -q compile -pl . clean.
1 parent 34d89b4 commit b740a7d

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/test/java/com/demcha/compose/document/dsl/InlineHighlightRenderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void chipMidLineKeepsTheTextOnBothSides() throws Exception {
133133

134134
@Test
135135
void multiWordChipStaysOneSpanAndCollapsesNewlines() throws Exception {
136-
// PR-1 invariant: a chip is one atomic token — a multi-word chip is a
136+
// Invariant: a chip is one atomic token — a multi-word chip is a
137137
// single span (not split per word), and an embedded newline collapses to
138138
// a space (unlike a plain text run, which would split into lines).
139139
List<ParagraphTextSpan> badge = textSpans(p -> p.inlineChip(" On hold ", DocumentColor.rgb(146, 64, 14), FILL));
@@ -151,7 +151,7 @@ void multiWordChipStaysOneSpanAndCollapsesNewlines() throws Exception {
151151

152152
@Test
153153
void overWideAtomicChipRendersWithoutThrowing() throws Exception {
154-
// A chip wider than the column is emitted on its own line (PR-1 atomic);
154+
// A chip wider than the column is emitted on its own line (atomic);
155155
// it must still render the text on one page without throwing.
156156
byte[] pdf;
157157
try (DocumentSession session = GraphCompose.document().pageSize(90, 140).margin(10, 10, 10, 10).create()) {

src/test/java/com/demcha/compose/document/templates/coverletter/presets/PresetVisualParityTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
* <p>Each preset renders a fixed canonical {@link CoverLetterSpec} on
2525
* full A4 with the gallery-standard 48pt margin, the resulting PDF is
2626
* rasterized via PDFBox, and the per-pixel diff against a checked-in
27-
* baseline PNG is asserted to stay within the budget specified in
28-
* {@code docs/private/templates-restructure-plan.md} sec 6.2 (2500
29-
* mismatched pixels at per-channel tolerance 8). Re-run with
27+
* baseline PNG is asserted to stay within the {@code PIXEL_DIFF_BUDGET}
28+
* mismatched-pixel budget at {@code PER_PIXEL_TOLERANCE} per-channel
29+
* colour tolerance. Re-run with
3030
* {@code -Dgraphcompose.visual.approve=true} to refresh the baselines
3131
* after a deliberate visual change.</p>
3232
*

src/test/java/com/demcha/compose/document/templates/cv/presets/PresetVisualParityTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
* <p>Each preset renders a fixed canonical {@link CvSpec} on full A4
3030
* with the preset's {@code RECOMMENDED_MARGIN}, the resulting PDF is
3131
* rasterized via PDFBox, and the per-pixel diff against a checked-in
32-
* baseline PNG is asserted to stay within the budget specified in
33-
* {@code docs/private/templates-restructure-plan.md} sec 6.2 (2500
34-
* mismatched pixels at per-channel tolerance 8). Re-run with
32+
* baseline PNG is asserted to stay within the {@code PIXEL_DIFF_BUDGET}
33+
* mismatched-pixel budget at {@code PER_PIXEL_TOLERANCE} per-channel
34+
* colour tolerance. Re-run with
3535
* {@code -Dgraphcompose.visual.approve=true} to refresh the baselines
3636
* after a deliberate visual change.</p>
3737
*

src/test/java/com/demcha/documentation/VersionConsistencyGuardTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void bundledFontsVersionAgreesAcrossModules() throws Exception {
7575
// the sibling module's source), so the ${graphcompose.fonts.version}
7676
// property that pins the artifact lives only in the modules that consume
7777
// it: the aggregator (inherited by examples + benchmarks) and the bundle.
78-
// This guards the PR-7.1 drift class: those must always agree, even
78+
// This guards the version-literal drift class: those must always agree, even
7979
// though they differ from the engine version line.
8080
String aggregator = fontsVersionProperty(PROJECT_ROOT.resolve("aggregator/pom.xml"));
8181

0 commit comments

Comments
 (0)