Skip to content

test(layout): a wrapped map title is checked where its names wrap - #3046

Merged
Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:fix/wrapped-title-test-fonts
Nov 26, 2026
Merged

Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:fix/wrapped-title-test-fonts

Conversation

@Mavrick-F

@Mavrick-F Mavrick-F commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Summary

a_wrapped_map_title_is_sized_for_its_drawn_lines (from #2972) fails on macOS and Windows. Since #2972 merged it fails main's push runs, and every pull request labelled ci:macos, ci:windows or ci:full.

The test picks map names that wrap in the Linux interface fonts. The macOS and Windows fonts are narrower, so the classic title fits on one line and assert!(wraps(...)) fails before the test reaches the sizing it is about.

On Linux the test still requires each title to wrap, so it keeps covering what it was written for. On macOS and Windows, a title that fits on one line has no lines to size and is skipped; one that wraps is still checked. Test-only change.

Testing

  • Fork CI on Linux, Windows x64 and Windows ARM64: all pass, this test included (run 45867224616).
  • macOS: the fork's macOS job couldn't get a runner (GitHub capacity), so it hasn't run yet. This PR carries ci:macos so the check runs here.

UI evidence

No visible UI change.

Related issue

Follow-up to #2972.

Summary by CodeRabbit

  • Tests
    • Updated map-title layout checks to account for platform-specific text wrapping while continuing to verify sizing when titles wrap.

a_wrapped_map_title_is_sized_for_its_drawn_lines (opengeos#2972) picks names that
wrap in the Linux interface fonts. On macOS and Windows a narrower font fits
the classic title on one line, so the test failed there and on main's push
runs. Linux still requires each title to wrap; elsewhere a title that fits on
one line has no lines to size and is skipped.
@Mavrick-F Mavrick-F added the ci:macos Run the macOS CI jobs on this pull request label Nov 26, 2026
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The map-title sizing test now requires wrapping on Linux. On other operating systems, it skips the sizing assertion when the title does not wrap.

Changes: Map-title wrapping test

Layer / File(s) Summary
Platform-aware wrapping assertion
crates/engine/src/tests/layout_title.rs
The test requires wrapping on Linux. On other operating systems, it continues to the next case if the title does not wrap. Wrapped titles are still checked for sizing against their drawn lines.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Possibly related issues

  • opengeos/RustGIS#3043: The issue reports platform-specific failures in the same test’s wrapping precondition. This change makes that precondition conditional outside Linux.

Possibly related PRs

  • opengeos/RustGIS#2972: This PR introduced the title wrapping and sizing behavior that the test covers.
  • opengeos/RustGIS#3045: This PR changes the same test to address the platform-specific wrapping failure with a different approach.

Suggested reviewers: m-hollis-1

Merge Risk: Minimal · up to a673f

This only adjusts a layout test so it tolerates font differences on macOS and Windows, with no user-visible change. Merge risk is minimal; the macOS CI run should be confirmed.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title describes the change: the test for a wrapped map title is now checked where its names wrap. It names the test area (layout) and the main behavior change. It matches the summary and objective…
Description check Passed The description follows the template's Summary, Testing, UI evidence, and Related issue sections. The Summary explains the failure on macOS and Windows, the cause (Linux-specific wrapping titles and n…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title describes the change: the test for a wrapped map title is now checked where its names wrap. It names the test area (layout) and the main behavior change. It matches the summary and objectives, which describe a platform-aware skip for titles that fit on one line, but the title does not mention platform differences. It is specific enough for a reader scanning history to find the primary change.

Full details: Description check

Explanation

The description follows the template's Summary, Testing, UI evidence, and Related issue sections. The Summary explains the failure on macOS and Windows, the cause (Linux-specific wrapping titles and narrower fonts), and the fix (Linux still requires wrapping; other platforms skip single-line titles). The Testing section lists fork CI results and the pending macOS run. The UI evidence section correctly says no visible UI change. The Related issue section links to #2972 as a follow-up, though it does not use the template's Closes/Part of wording.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the title line,
On Linux, wraps are by design.
Else, if the words fit just right,
The test moves on without a fight.
Drawn lines still get their sizing check,
Then hops away with ears erect.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: bbd8a7f3-a479-4441-bc98-bda0fc8b7277
Commits

Reviewing files that changed from the base of the PR and between d120c6e and a673fca.

Files selected for processing: 1

  • crates/engine/src/tests/layout_title.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.

Comment on lines +163 to +167
if cfg!(target_os = "linux") {
assert!(wraps(&s, li, "Title"), "{style}");
} else if !wraps(&s, li, "Title") {
continue;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On macOS and Windows, if none of the four names wraps, every iteration hits continue and the test passes with zero assertions. The PR's Windows green run therefore doesn't show the sizing was checked there. Suggest counting the cases that were actually checked and asserting at least one ran, e.g. let mut checked = 0; before the loop, checked += 1; after the continue guard, and assert!(checked > 0, "no title wrapped on this platform"); after the loop. Alternatively, lengthen the names so they wrap everywhere and keep the Linux-only skip out of the test entirely.

I could not run the tests here, so whether the names fit on macOS or Windows is unverified.

Category: quality

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left for the release quality pass: asserting at least one case ran needs knowing which names wrap in the macOS and Windows fonts, which this PR's runs will show.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Bugs: None found. The change is test-only and the cfg! branch compiles on every target.

Security: None found.

Performance: None found.

Quality:

  • crates/engine/src/tests/layout_title.rs:163-167: On macOS and Windows, if none of the four names wraps, every iteration hits continue and the test passes with zero assertions. The PR's Windows green run therefore doesn't show the sizing was checked there. Suggested fix: count the checked cases and assert at least one ran, or lengthen the names so they wrap on every platform. Confidence: high that the code can pass vacuously; medium on whether it does on macOS or Windows, since I couldn't run the tests or check font metrics.

AGENTS.md: No breaches found. The test-hygiene rules are met: there are no timer waits, and no assert_eq! compares identical tokens.

Checked and left alone: No earlier review threads existed on this PR, so nothing was already raised. I read the helpers wraps, drawn_lines and sized_lines and the neighbouring tests in the same file. The family-twin rules don't apply to a test-only change.

Change size

Compared with main (merge base d120c6e to PR head a673fca), covering the whole PR.

Measure Value
Files changed 1 (added 0, modified 1, removed 0, renamed 0)
Size before 14.9 KB
Size after 15.2 KB
Total size change +263 B
Path Before After Change
crates/engine/src/tests/layout_title.rs 14.9 KB 15.2 KB +263 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3046/
Web app https://preview.rustgis.app/pr-3046/app/
Commit a673fca

GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).

@Mavrick-F
Mavrick-F added this pull request to the merge queue Nov 26, 2026
Merged via the queue into opengeos:main with commit c2bf412 Nov 26, 2026
47 checks passed
@Mavrick-F
Mavrick-F deleted the fix/wrapped-title-test-fonts branch November 26, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:macos Run the macOS CI jobs on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant