| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package sub_timeline_fixer
- import (
- "github.com/allanpk716/ChineseSubFinder/internal/pkg/settings"
- "github.com/allanpk716/ChineseSubFinder/internal/pkg/unit_test_helper"
- "path/filepath"
- "testing"
- )
- // TODO 暂不方便在其他环境进行单元测试
- func TestSubTimelineFixerHelperEx_Check(t *testing.T) {
- //if NewSubTimelineFixerHelperEx(config.GetConfig().SubTimelineFixerConfig).Check() == false {
- // t.Fatal("Need Install FFMPEG")
- //}
- }
- // TODO 暂不方便在其他环境进行单元测试
- func TestSubTimelineFixerHelperEx_Process(t *testing.T) {
- rootDir := unit_test_helper.GetTestDataResourceRootPath([]string{"sub_timeline_fixer"}, 4, true)
- type args struct {
- videoFileFullPath string
- srcSubFPath string
- }
- tests := []struct {
- name string
- args args
- wantErr bool
- }{
- {
- name: "Foundation (2021) - S01E09", args: args{
- videoFileFullPath: "X:\\连续剧\\Foundation (2021)\\Season 1\\Foundation (2021) - S01E09 - The First Crisis WEBDL-1080p.mkv",
- srcSubFPath: filepath.Join(rootDir, "series", "Foundation (2021)", "Season 1", "Foundation (2021) - S01E09 - The First Crisis WEBDL-1080p.chinese(简英,zimuku).ass")},
- wantErr: false,
- },
- }
- s := NewSubTimelineFixerHelperEx(*settings.NewTimelineFixerSettings())
- s.Check()
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if err := s.Process(tt.args.videoFileFullPath, tt.args.srcSubFPath); (err != nil) != tt.wantErr {
- t.Errorf("Process() error = %v, wantErr %v", err, tt.wantErr)
- }
- })
- }
- }
|