sub_file_hash_test.go 694 B

12345678910111213141516171819202122232425262728293031323334
  1. package sub_file_hash
  2. import (
  3. "path/filepath"
  4. "testing"
  5. "github.com/ChineseSubFinder/ChineseSubFinder/pkg/unit_test_helper"
  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. }