util_test.go 749 B

12345678910111213141516171819202122232425262728293031
  1. package my_util
  2. import (
  3. "github.com/allanpk716/ChineseSubFinder/internal/pkg/log_helper"
  4. "github.com/allanpk716/ChineseSubFinder/internal/pkg/unit_test_helper"
  5. "path/filepath"
  6. "testing"
  7. )
  8. func TestCloseChrome(t *testing.T) {
  9. // BUG: will produce Logs under this dir
  10. CloseChrome(log_helper.GetLogger())
  11. }
  12. func TestFileNameIsBDMV(t *testing.T) {
  13. rootDir := unit_test_helper.GetTestDataResourceRootPath([]string{"movies", "失控玩家 (2021)"}, 4, false)
  14. dbmvFPath := filepath.Join(rootDir, "CERTIFICATE", "id.bdmv")
  15. bok, fakeVideoFPath := FileNameIsBDMV(dbmvFPath)
  16. if bok == false {
  17. t.Fatal("FileNameIsBDMV error")
  18. }
  19. println(fakeVideoFPath)
  20. }
  21. func TestGetRestOfDaySec(t *testing.T) {
  22. rest := GetRestOfDaySec()
  23. println(rest)
  24. }