Skip to content

Commit

Permalink
Add non-utf-8 tests and files
Browse files Browse the repository at this point in the history
  • Loading branch information
nakkamarra committed Oct 7, 2024
1 parent 9f1c78b commit aca49fa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions srt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ func TestSRTMissingSequence(t *testing.T) {
assert.Equal(t, string(c), w.String())
}

func TestNonUTF8SRT(t *testing.T) {
_, err := astisub.OpenFile("./testdata/example-in-non-utf8.srt")
assert.Error(t, err)
}

func BenchmarkOpenSRT(b *testing.B) {
f, _ := os.Open("./testdata/example-in.srt")
defer f.Close()
Expand Down
Binary file added testdata/example-in-non-utf8.srt
Binary file not shown.
Binary file added testdata/example-in-non-utf8.vtt
Binary file not shown.
5 changes: 5 additions & 0 deletions webvtt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ func TestBroken1WebVTT(t *testing.T) {
assert.Nil(t, err)
}

func TestNonUTF8WebVTT(t *testing.T) {
_, err := astisub.OpenFile("./testdata/example-in-non-utf8.vtt")
assert.Error(t, err)
}

func TestWebVTTWithVoiceName(t *testing.T) {
testData := `WEBVTT
Expand Down

0 comments on commit aca49fa

Please sign in to comment.