diff --git a/extractor/openrec/openrec_test.go b/extractor/openrec/openrec_test.go index 33cb210..3c7eb9f 100644 --- a/extractor/openrec/openrec_test.go +++ b/extractor/openrec/openrec_test.go @@ -19,6 +19,20 @@ import ( "github.com/tidwall/gjson" ) +func TestCase0(t *testing.T) { + f, err := os.Open("./test.html") + if err != nil { + panic(err) + } + data, err := ioutil.ReadAll(f) + if err != nil { + panic(err) + } + + matheslist := regexp.MustCompile(`TagButton__Button[^>]+>(.{1,100})(.+)").FindStringSubmatch(livejson.Str) + mathes := regexp.MustCompile("MovieTitle__Title[^>]+>(.{1,50})").FindStringSubmatch(livejson.Str) if len(mathes) == 2 { clog.SetShowTitle(sql.NullString{String: mathes[1], Valid: true}) @@ -232,8 +246,19 @@ func TestExtractor(t *testing.T) { } } - matheslist := regexp.MustCompile(`TagButton__Button.+>([^<]+)<`).FindAllStringSubmatch(livejson.Str, 0) - t.Error(matheslist) + var tags []string + matheslist := regexp.MustCompile(`TagButton__Button[^>]+>(.{1,100})