-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsize_test.go
More file actions
43 lines (40 loc) · 1.13 KB
/
size_test.go
File metadata and controls
43 lines (40 loc) · 1.13 KB
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
package ptt
import (
"testing"
)
func TestSizeGroupDetection(t *testing.T) {
cases := []struct {
releaseName string
expectedSize *string
}{
{
releaseName: "www.1TamilBlasters.lat - Thuritham (2023) [Tamil - 2K QHD AVC UNTOUCHED - x264 - AAC - 3.4GB - ESub].mkv",
expectedSize: strPtr("3.4GB"),
},
{
releaseName: "www.1TamilMV.world - Raja Vikramarka (2024) Tamil HQ HDRip - 400MB - x264 - AAC - ESub.mkv",
expectedSize: strPtr("400MB"),
},
{
releaseName: "www.1TamilMV.cz - Maharaja (2024) TRUE WEB-DL - 1080p HQ - AVC - (DD+5.1 - 640Kbps) [Tam + Tel + Hin + Mal + Kan] - 8.4GB - ESub.mkv",
expectedSize: strPtr("8.4GB"),
},
{
releaseName: "The.Walking.Dead.S06E07.SUBFRENCH.HDTV.x264-AMB3R.mkv",
expectedSize: nil,
},
}
p := newTestParser()
for _, tt := range cases {
result := p.Parse(tt.releaseName)
if tt.expectedSize != nil {
if result.Size != *tt.expectedSize {
t.Fatalf("%s: Size = %q, want %q", tt.releaseName, result.Size, *tt.expectedSize)
}
} else {
if result.Size != "" {
t.Fatalf("%s: expected Size to be empty, got %q", tt.releaseName, result.Size)
}
}
}
}