fix: duplicate-tab folder is a sibling, not a child, when source ends in /

".../AlexisCrystal/" + "_copy" was producing ".../AlexisCrystal/_copy"; rstrip
the trailing separator first → ".../AlexisCrystal_copy". Regression test uses a
trailing-slash source folder.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-18 14:52:12 +02:00
parent d7680283a2
commit 1eb7de2a1a
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -127,7 +127,7 @@ def test_duplicate_tab(win):
try:
src = win._pws[0]
src._label = "AlexisCrystal"
src._dest_folder = "/data/alexis"
src._dest_folder = "/data/alexis/" # trailing slash, like real folders
n_before = len(win._pws)
win._on_duplicate_tab(win._playlist_tabs.indexOf(src))
finally:
@@ -135,4 +135,5 @@ def test_duplicate_tab(win):
assert len(win._pws) == n_before + 1
dup = win._pws[-1]
assert dup._label == "AlexisCrystal copy"
# sibling, not a child: ".../alexis/" -> ".../alexis_copy" (not ".../alexis/_copy")
assert dup._dest_folder == "/data/alexis_copy"