Browse Source

增加和调整测试用例

Signed-off-by: allan716 <[email protected]>
allan716 4 years ago
parent
commit
d82fdd46c0
2 changed files with 24 additions and 11 deletions
  1. 23 0
      common/decode_test.go
  2. 1 11
      sub_supplier/subhd/subhd_test.go

+ 23 - 0
common/decode_test.go

@@ -94,4 +94,27 @@ func Test_VideoInfo(t *testing.T) {
 	println(s1.Title, s1.Season, s1.Episode, s1.Quality, s1.Codec, s1.Hardcoded)
 
 
+}
+
+func TestGetNumber2Float(t *testing.T) {
+	testString := "asd&^%1998.2jh aweo "
+	outNumber, err := GetNumber2Float(testString)
+	if err != nil {
+		t.Error(err)
+	}
+	if outNumber != 1998.2 {
+		t.Error("not the same")
+	}
+}
+
+func TestGetNumber2int(t *testing.T) {
+
+	testString := "asd&^%1998jh aweo "
+	outNumber, err := GetNumber2int(testString)
+	if err != nil {
+		t.Error(err)
+	}
+	if outNumber != 1998 {
+		t.Error("not the same")
+	}
 }

+ 1 - 11
sub_supplier/subhd/subhd_test.go

@@ -6,17 +6,7 @@ import (
 )
 
 func TestSupplier_GetSubListFromFile(t *testing.T) {
-	//httpProxy := "127.0.0.1:10809"
-	////testUrl := "https://github.com/go-rod/rod/issues?q=page+string%28%29+"
-	////page, err := common.NewBrowserLoadPage(testUrl, httpProxy, 10*time.Second, 5)
-	//page, err := common.NewBrowserLoadPage(common.SubSubHDRootUrl, "", 10*time.Second, 5)
-	//if err != nil {
-	//	return
-	//}
-	//page = page.MustWaitLoad()
-	//htmlString := page.MustHTML()
-	//println(htmlString)
-
+	
 	movie1 := "X:\\电影\\消失爱人 (2016)\\消失爱人 (2016) 720p AAC.rmvb"
 	//movie1 := "X:\\电影\\机动战士Z高达:星之继承者 (2005)\\机动战士Z高达:星之继承者 (2005) 1080p TrueHD.mkv"
 	//movie1 := "X:\\连续剧\\The Bad Batch\\Season 1\\The Bad Batch - S01E01 - Aftermath WEBDL-1080p.mkv"