fix(filters): add support for year-less titles (#685)

* fix(filters): add support for year-less titles

* chore: update pkg

* fix: broken tests

---------

Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
Kyle Sanderson 2023-02-02 14:45:19 -08:00 committed by GitHub
parent 27f8b14678
commit af43c98632
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 90 additions and 36 deletions

View file

@ -858,3 +858,53 @@ func TestRelease_DownloadTorrentFile(t *testing.T) {
})
}
}
func Test_getUniqueTags(t *testing.T) {
type args struct {
target []string
source []string
}
tests := []struct {
name string
args args
want []string
}{
{
name: "1",
args: args{
target: []string{},
source: []string{"mp4"},
},
want: []string{"mp4"},
},
{
name: "2",
args: args{
target: []string{"mp4"},
source: []string{"mp4"},
},
want: []string{"mp4"},
},
{
name: "3",
args: args{
target: []string{"mp4"},
source: []string{"mp4", "dv"},
},
want: []string{"mp4", "dv"},
},
{
name: "4",
args: args{
target: []string{"dv"},
source: []string{"mp4", "dv"},
},
want: []string{"dv", "mp4"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
assert.Equalf(t, tt.want, getUniqueTags(tt.args.target, tt.args.source), "getUniqueTags(%v, %v)", tt.args.target, tt.args.source)
})
}
}