Skip to content

Commit

Permalink
fixup! [webvtt/test] Testcase for webvtt tags
Browse files Browse the repository at this point in the history
  • Loading branch information
NhanNguyen700 committed Nov 21, 2023
1 parent 7b49b90 commit f85fc97
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions webvtt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,15 @@ func TestWebVTTTags(t *testing.T) {
<v Joe><c.red><i>Joe's words are red in italic</i></c>
00:04:00.000 --> 00:05:00.000
<customed_tag.class1.class2>Text here</customed_tag>`
<customed_tag.class1.class2>Text here</customed_tag>
00:05:00.000 --> 00:06:00.000
<v Joe>Joe says something</v> <v Bob>Bob says something</v>`

s, err := astisub.ReadFromWebVTT(strings.NewReader(testData))
require.NoError(t, err)

require.Len(t, s.Items, 4)
require.Len(t, s.Items, 5)

b := &bytes.Buffer{}
err = s.WriteToWebVTT(b)
Expand All @@ -203,5 +206,9 @@ func TestWebVTTTags(t *testing.T) {
4
00:04:00.000 --> 00:05:00.000
<customed_tag.class1.class2>Text here</customed_tag>
5
00:05:00.000 --> 00:06:00.000
<v Joe>Joe says something Bob says something
`, b.String())
}

0 comments on commit f85fc97

Please sign in to comment.