-
Notifications
You must be signed in to change notification settings - Fork 2
/
source_test.go
55 lines (53 loc) · 1.26 KB
/
source_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package torrentparser
import "testing"
func TestParser_GetSource(t *testing.T) {
tests := []struct {
desc string
name string
want string
}{
{
desc: "Not tc from the word watchmen",
name: "Watchmen.The.Ultimate.Cut.2009.1080p.BluRay.AC3.x264-CtrlHD.mkv",
want: "bluray",
},
{
desc: "Not tc from the word pitch",
name: "Pitch.Perfect.2.2015.REPACK.1080p.BluRay.DTS.x264-VietHD.mkv",
want: "bluray",
},
{
desc: "bdremux extracted",
name: "Pitch.Perfect.2.2015.REPACK.1080p.BDRemux.DTS.x264-VietHD.mkv",
want: "bdremux",
},
{
desc: "remux extracted",
name: "Pitch.Perfect.2.2015.REPACK.1080p.REMUX.DTS.x264-VietHD.mkv",
want: "remux",
},
{
desc: "blu-ray extracted",
name: "Pitch.Perfect.2.2015.REPACK.1080p.Blu-Ray.DTS.x264-VietHD.mkv",
want: "blu-ray",
},
{
desc: "extract web",
name: "Stephen.Colbert.2023.02.15.Jim.Gaffigan.1080p.WEB.H264-JEBAITED.mkv",
want: "web",
},
{
desc: "extract telesync",
name: "Black.Adam.2022.1080p.TELESYNC.x264-iDiOTS.mkv",
want: "telesync",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
p, _ := ParseName(tt.name)
if got := p.Source; got != tt.want {
t.Errorf("Parser.GetSource() = %v, want %v", got, tt.want)
}
})
}
}