test_statistics_subs_score_test.go 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package TestCode
  2. import "testing"
  3. func Test_statistics_subs_score(t *testing.T) {
  4. type args struct {
  5. baseAudioFileFPath string
  6. baseSubFileFPath string
  7. subSearchRootPath string
  8. }
  9. tests := []struct {
  10. name string
  11. args args
  12. }{
  13. {
  14. name: "Test_statistics_subs_score",
  15. args: args{
  16. baseAudioFileFPath: "C:\\temp\\video\\base\\RM-S05E01\\未知语言_1.pcm",
  17. baseSubFileFPath: "C:\\temp\\video\\base\\RM-S05E01\\英_2.srt",
  18. subSearchRootPath: "X:\\电影",
  19. },
  20. },
  21. }
  22. for _, tt := range tests {
  23. t.Run(tt.name, func(t *testing.T) {
  24. statistics_subs_score(tt.args.baseAudioFileFPath, tt.args.baseSubFileFPath, tt.args.subSearchRootPath)
  25. })
  26. }
  27. }
  28. func Test_statistics_subs_score_one(t *testing.T) {
  29. type args struct {
  30. baseAudioFileFPath string
  31. baseSubFileFPath string
  32. srcSubFileFPath string
  33. }
  34. tests := []struct {
  35. name string
  36. args args
  37. }{
  38. {
  39. name: "Test_statistics_subs_score_one",
  40. args: args{
  41. baseAudioFileFPath: "C:\\temp\\video\\base\\RM-S05E01\\未知语言_1.pcm",
  42. baseSubFileFPath: "C:\\temp\\video\\base\\RM-S05E01\\英_2.srt",
  43. srcSubFileFPath: "C:\\temp\\video\\Rick and Morty - S05E01 - Mort Dinner Rick Andre WEBDL-1080p.chinese(简英,fix).srt",
  44. },
  45. },
  46. {
  47. name: "Test_statistics_subs_score_one2",
  48. args: args{
  49. baseAudioFileFPath: "C:\\temp\\video\\base\\RM-S05E01\\未知语言_1.pcm",
  50. baseSubFileFPath: "C:\\temp\\video\\base\\RM-S05E01\\英_2.srt",
  51. srcSubFileFPath: "C:\\temp\\video\\The Boys - S03E01 - Payback WEBRip-1080p.chinese(简英,subhd).ass",
  52. },
  53. },
  54. }
  55. for _, tt := range tests {
  56. t.Run(tt.name, func(t *testing.T) {
  57. statistics_subs_score_one(tt.args.baseAudioFileFPath, tt.args.baseSubFileFPath, tt.args.srcSubFileFPath)
  58. })
  59. }
  60. }
  61. func Test_statistics_subs_score_is_match(t *testing.T) {
  62. type args struct {
  63. videoFPath string
  64. subSearchRootPath string
  65. }
  66. tests := []struct {
  67. name string
  68. args args
  69. }{
  70. {
  71. name: "Test_statistics_subs_score_is_match",
  72. args: args{
  73. videoFPath: "C:\\temp\\video\\Rick and Morty - S05E01 - Mort Dinner Rick Andre WEBDL-1080p.mkv",
  74. subSearchRootPath: "X:\\连续剧\\瑞克和莫蒂 (2013)",
  75. },
  76. },
  77. }
  78. for _, tt := range tests {
  79. t.Run(tt.name, func(t *testing.T) {
  80. statistics_subs_score_is_match(tt.args.videoFPath, tt.args.subSearchRootPath)
  81. })
  82. }
  83. }