Skip to content

Commit

Permalink
fix some deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlindhe committed Sep 9, 2024
1 parent 101f041 commit af09c17
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 32 deletions.
4 changes: 2 additions & 2 deletions ccdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ func TestNewFromCCDBCapture(t *testing.T) {
makeTime(0, 0, 16, 24),
makeTime(0, 1, 25, 82),
[]string{"Whoa."},
}, Caption{
}, {
2,
makeTime(0, 1, 31, 45),
makeTime(0, 1, 33, 62),
[]string{"Go on. Get out."},
}, Caption{
}, {
3,
makeTime(0, 1, 33, 65),
makeTime(0, 1, 34, 81),
Expand Down
2 changes: 1 addition & 1 deletion cleaner.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var (
// english:
"captions paid for by",
"english subtitles",
"subtitles:", "subtitles by",
"subtitles -", "subtitles:", "subtitles by",
"subtitles downloaded",
"captioning by", "captions by",
"transcript :", "transcript:", "transcript by",
Expand Down
8 changes: 4 additions & 4 deletions filter_ocr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ func TestStartsWithUppercase(t *testing.T) {

func TestCountCaseInLetters(t *testing.T) {
input := map[string][]caseCount{
"HELLO": []caseCount{{upper, 5}},
"hello": []caseCount{{lower, 5}},
"Hello": []caseCount{{upper, 1}, {lower, 4}},
"GAsPs": []caseCount{{upper, 2}, {lower, 1}, {upper, 1}, {lower, 1}},
"HELLO": {{upper, 5}},
"hello": {{lower, 5}},
"Hello": {{upper, 1}, {lower, 4}},
"GAsPs": {{upper, 2}, {lower, 1}, {upper, 1}, {lower, 1}},
}
for in, out := range input {
assert.Equal(t, out, countCaseInLetters(in))
Expand Down
22 changes: 0 additions & 22 deletions helpers.go

This file was deleted.

6 changes: 3 additions & 3 deletions testextras.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package subtitles

import (
"fmt"
"io/ioutil"
"os"
)

const tempFilePrefix = "moviehash-temp"
Expand All @@ -25,7 +25,7 @@ func createTempFile(byteSize int) string {
cnt++
}

f, err := ioutil.TempFile("/tmp", tempFilePrefix)
f, err := os.CreateTemp("/tmp", tempFilePrefix)
check(err)
defer f.Close()

Expand All @@ -39,7 +39,7 @@ func createZeroedTempFile(byteSize int) string {

data := make([]byte, byteSize)

f, err := ioutil.TempFile("/tmp", tempFilePrefix)
f, err := os.CreateTemp("/tmp", tempFilePrefix)
check(err)
defer f.Close()

Expand Down

0 comments on commit af09c17

Please sign in to comment.