sub_file_hash_test.go 696 B

123456789101112131415161718192021222324252627282930313233
  1. package sub_file_hash
  2. import (
  3. "github.com/allanpk716/ChineseSubFinder/internal/pkg/unit_test_helper"
  4. "path/filepath"
  5. "testing"
  6. )
  7. func TestCalculate(t *testing.T) {
  8. rootDir := unit_test_helper.GetTestDataResourceRootPath([]string{"sub_spplier"}, 4, true)
  9. rootDir = filepath.Join(rootDir, "csf")
  10. gVideoFPath, err := unit_test_helper.GenerateCSFVideoFile(rootDir)
  11. if err != nil {
  12. t.Fatal(err)
  13. }
  14. calculate, err := Calculate(gVideoFPath)
  15. if err != nil {
  16. t.Fatal(err)
  17. }
  18. if calculate != checkHash {
  19. t.Fatal("Hash not the same")
  20. }
  21. //dd := "X:\\电影\\失控玩家 (2021)\\失控玩家 (2021).mp4"
  22. //calculate, err := Calculate(dd)
  23. //if err != nil {
  24. // t.Fatal(err)
  25. //}
  26. }