-
Notifications
You must be signed in to change notification settings - Fork 2
/
misc_test.go
87 lines (83 loc) · 1.86 KB
/
misc_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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package torrentparser
import "testing"
func TestParser_GetUnrated(t *testing.T) {
tests := []struct {
name string
want bool
}{
{
name: "Identity.Thief.2013.Vostfr.UNRATED.BluRay.720p.DTS.x264-Nenuko",
want: true,
},
{
name: "Charlie.les.filles.lui.disent.merci.2007.UNCENSORED.TRUEFRENCH.DVDRiP.AC3.Libe",
want: true,
},
{
name: "Have I Got News For You S53E02 EXTENDED 720p HDTV x264-QPEL",
want: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
p, _ := ParseName(tt.name)
if got := p.Unrated; got != tt.want {
t.Errorf("Parser.GetUnrated() = %v, want %v", got, tt.want)
}
})
}
}
func TestParser_Repack(t *testing.T) {
tests := []struct {
name string
want bool
}{
{
name: "Ascension.2021.REPACK.1080p.AMZN.WEB-DL.DDP5.1.H.264-WELP.mkv",
want: true,
},
{
name: "Asterix.Le.Secret.de.la.Potion.Magique.2018.FRENCH.1080p.BluRay.DTS.x264-Ulysse.mp4",
want: false,
},
{
name: "The.Tomorrow.War.2021.repack.HDR.2160p.WEB.H265-NAISU.mp4",
want: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
p, _ := ParseName(tt.name)
if got := p.Repack; got != tt.want {
t.Errorf("Parser.Repack() = %v, want %v", got, tt.want)
}
})
}
}
func TestParser_Extended(t *testing.T) {
tests := []struct {
name string
want bool
}{
{
name: "Night School 2018 Extended 1080p BluRay DD+7.1 x264-DON.mkv",
want: true,
},
{
name: "Asterix.Le.Secret.de.la.Potion.Magique.2018.FRENCH.1080p.BluRay.DTS.x264-Ulysse.mp4",
want: false,
},
{
name: "Have I Got News For You S53E02 EXTENDED 720p HDTV x264-QPEL",
want: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
p, _ := ParseName(tt.name)
if got := p.Extended; got != tt.want {
t.Errorf("Parser.Extended() = %v, want %v", got, tt.want)
}
})
}
}