Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,20 @@ class LocalMusicFolderIdentityTest {
fun `keeps a top-level folder name`() {
assertEquals("Music", LocalMusicFolderIdentity.displayName("Music/"))
}

@Test
fun `normalizes edge cases with complex separators`() {
// multiple slashes
assertEquals("foo/bar", LocalMusicFolderIdentity.displayPath("foo///bar"))
// mixed slashes and backslashes
assertEquals("foo/bar", LocalMusicFolderIdentity.displayPath("foo\\//bar"))
// multiple backslashes
assertEquals("foo/bar", LocalMusicFolderIdentity.displayPath("foo\\\\\\bar"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: The five source backslashes before bar are parsed as two escaped backslashes followed by the \b backspace escape, so the test input contains a backspace and ar rather than three path separators followed by bar. normalizePath will therefore not produce foo/bar, causing this test to fail for an incorrectly encoded fixture. Encode each intended backslash with two source backslashes. [type error]

Severity Level: Major ⚠️
- ❌ LocalMusicFolderIdentityTest fails whenever the test suite runs.
- ⚠️ CI validation cannot pass for the new separator regression test.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent πŸ€–
This is a comment left during a code review.

**Path:** app/src/test/java/com/rockmusic/app/data/local/LocalMusicFolderIdentityTest.kt
**Line:** 39:39
**Comment:**
	*Type Error: The five source backslashes before `bar` are parsed as two escaped backslashes followed by the `\b` backspace escape, so the test input contains a backspace and `ar` rather than three path separators followed by `bar`. `normalizePath` will therefore not produce `foo/bar`, causing this test to fail for an incorrectly encoded fixture. Encode each intended backslash with two source backslashes.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
πŸ‘ | πŸ‘Ž

// leading and trailing mixed separators
assertEquals("foo", LocalMusicFolderIdentity.displayPath("\\/foo/\\"))
// only separators
assertEquals("Internal storage", LocalMusicFolderIdentity.displayPath("///\\\\\\"))
// spaces as segments (note: filter(String::isNotBlank) drops these)
assertEquals("foo/bar", LocalMusicFolderIdentity.displayPath("foo/ /bar/ /"))
}
}
Loading