Fix the absolutely retarded single match crutch

This commit is contained in:
2025-11-20 15:12:01 +01:00
parent b35697d227
commit 079fc82ab9
2 changed files with 29 additions and 18 deletions

View File

@@ -758,8 +758,8 @@ func TestGlobPatterns(t *testing.T) {
expectedMappings := map[string]string{
"src/file1.txt": "dst/txt/file1.txt",
"src/file2.txt": "dst/txt/file2.txt",
"src/file3.log": "dst/logs", // Single file - target is directory directly
"src/readme.md": "dst/docs", // Single file - target is directory directly
"src/file3.log": "dst/logs/file3.log",
"src/readme.md": "dst/docs/readme.md",
}
for sourceEnd, expectedTargetEnd := range expectedMappings {
@@ -1469,7 +1469,7 @@ func TestDestinationPathMapping(t *testing.T) {
instruction := instructions[0]
// Verify using path endings
assert.True(t, strings.HasSuffix(instruction.Source, "src/root.txt"))
assert.True(t, strings.HasSuffix(instruction.Target, "dst")) // Single file - target is directory directly
assert.True(t, strings.HasSuffix(instruction.Target, "dst/root.txt"))
})
t.Run("src/foo/*.txt -> dst should map src/foo/foo.txt to dst/foo.txt", func(t *testing.T) {
@@ -1486,7 +1486,7 @@ func TestDestinationPathMapping(t *testing.T) {
instruction := instructions[0]
// Verify using path endings
assert.True(t, strings.HasSuffix(instruction.Source, "src/foo/foo.txt"))
assert.True(t, strings.HasSuffix(instruction.Target, "dst")) // Single file - target is directory directly
assert.True(t, strings.HasSuffix(instruction.Target, "dst/foo.txt"))
})
t.Run("Complex nested pattern src/foo/**/bar/*.txt -> dst should preserve structure", func(t *testing.T) {