Additional test with special symbols

This commit is contained in:
rumanzo 2023-11-26 16:27:40 +03:00
parent ed90ba1226
commit a25c2670ff
No known key found for this signature in database

View File

@ -1191,6 +1191,35 @@ func TestTransferStructure_HandleSavePaths(t *testing.T) {
},
},
},
{
name: "035 Test torrent with windows folder (NoSubfolder) with special symbols.",
newTransferStructure: &TransferStructure{
Fastresume: &qBittorrentStructures.QBittorrentFastresume{},
ResumeItem: &utorrentStructs.ResumeItem{Path: `D:\torrents\renamed test_torrent`},
TorrentFile: &torrentStructures.Torrent{
Info: &torrentStructures.TorrentInfo{
Name: "test_torrent",
Files: []*torrentStructures.TorrentFile{
&torrentStructures.TorrentFile{Path: []string{`#test _ test [01]{1} [6K].jpg`}},
&torrentStructures.TorrentFile{Path: []string{`testdir1 collection`, `testdir2_`, `1.jpg`}},
},
},
},
Opts: &options.Opts{PathSeparator: `\`},
},
expected: &TransferStructure{
Fastresume: &qBittorrentStructures.QBittorrentFastresume{
QbtSavePath: `D:/torrents/renamed test_torrent`,
SavePath: `D:\torrents\renamed test_torrent`,
QBtContentLayout: "NoSubfolder",
MappedFiles: []string{
`#test _ test [01]{1} [6K].jpg`,
`testdir1 collection\testdir2_\1.jpg`,
},
},
Opts: &options.Opts{PathSeparator: `\`},
},
},
}
for _, testCase := range cases {
t.Run(testCase.name, func(t *testing.T) {