Skip to content

Use System.lineSeparator() in OptionalMatchersTest expectations - #447

Open
seethinajayadileep wants to merge 1 commit into
hamcrest:masterfrom
seethinajayadileep:fix/438-optional-matchers-windows-line-separator
Open

Use System.lineSeparator() in OptionalMatchersTest expectations#447
seethinajayadileep wants to merge 1 commit into
hamcrest:masterfrom
seethinajayadileep:fix/438-optional-matchers-windows-line-separator

Conversation

@seethinajayadileep

Copy link
Copy Markdown

Summary

OptionalMatchersTest compared AssertionError messages against strings with hardcoded LF (\n). On Windows those expectations fail because Hamcrest uses System.lineSeparator(). This switches the expectations to System.lineSeparator().

Test plan

  • ./gradlew :hamcrest:test --tests org.hamcrest.optional.OptionalMatchersTest

Fixes #438

Hardcoded LF in expected AssertionError messages fails on Windows.
Use System.lineSeparator() so the tests pass across platforms.

Fixes hamcrest#438

Signed-off-by: JAYA DILEEP <seethinajayadileep@hotmail.com>
@seethinajayadileep
seethinajayadileep marked this pull request as ready for review September 5, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OptionalMatchersTest tests fail on Windows

1 participant