From a25c2670ff334e77bde69c5c55ef9f5074a00c61 Mon Sep 17 00:00:00 2001 From: rumanzo Date: Sun, 26 Nov 2023 16:27:40 +0300 Subject: [PATCH] Additional test with special symbols --- internal/transfer/transfer_test.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/internal/transfer/transfer_test.go b/internal/transfer/transfer_test.go index 6e005f3..d603794 100644 --- a/internal/transfer/transfer_test.go +++ b/internal/transfer/transfer_test.go @@ -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) {