Fix path separator assertions in tests for Windows compatibility - #121
Merged
Conversation
Two tests construct a root path via Paths.get("/") and assert the
"file name is null -> fall back to the full path string" branch using a
hardcoded POSIX separator. On Windows Paths.get("/").toString() returns
"\", so the assertions failed there while passing on Linux/macOS. The
production code is correct (it intentionally falls back to the full
Path.toString() when getFileName() is null); only the expected values
were hardcoded to "/".
Derive the expected string from the same Path object instead of
hardcoding the separator. Paths.get("/") still yields a null file name
on every OS, so the intended fallback branch stays exercised:
- AiPromptSupportTest.buildPromptUsesFullPathWhenFileNameNull
- MockAiGenerationProviderTest.generateFallsBackToFullPathWhenFileNameNull
mvn test: Tests run: 174, Failures: 0, Errors: 0, Skipped: 1.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FHNW6HtnBwNm3DFRGuHxfZ
bernardladenthin
had a problem deploying
to
startgate
June 26, 2026 15:14 — with
GitHub Actions
Error
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
/) in expected path strings, causing failures on Windows wherePaths.get("/")renders with backslashesMockAiGenerationProviderTest.generateFallsBackToFullPathWhenFileNameNull()andAiPromptSupportTest.buildPromptUsesFullPathWhenFileNameNull()to derive expected path strings from the actualPathobject being testedTest plan
Related issues / PRs
Fixes cross-platform test failures on Windows.
Checklist
CONTRIBUTING.mdandCODE_OF_CONDUCT.mdhttps://claude.ai/code/session_01FHNW6HtnBwNm3DFRGuHxfZ