Skip to content

Commit 1fc83f9

Browse files
authored
test: Remove use of "mitchellh/go-testing-interface" for stdlib (#523)
1 parent 07eac9d commit 1fc83f9

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

decompress_testing.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ import (
1414
"runtime"
1515
"sort"
1616
"strings"
17+
"testing"
1718
"time"
18-
19-
"github.com/mitchellh/go-testing-interface"
2019
)
2120

2221
// TestDecompressCase is a single test case for testing decompressors
@@ -30,7 +29,7 @@ type TestDecompressCase struct {
3029
}
3130

3231
// TestDecompressor is a helper function for testing generic decompressors.
33-
func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) {
32+
func TestDecompressor(t testing.TB, d Decompressor, cases []TestDecompressCase) {
3433
t.Helper()
3534

3635
for _, tc := range cases {
@@ -83,7 +82,7 @@ func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) {
8382
t.Fatalf("err %s: expected mtime '%s' for %s, got '%s'", tc.Input, expected.String(), dst, actual.String())
8483
}
8584
} else if actual.Unix() <= 0 {
86-
t.Fatalf("err %s: expected mtime to be > 0, got '%s'", actual.String())
85+
t.Fatalf("err %s: expected mtime to be > 0, got '%s'", tc.Input, actual.String())
8786
}
8887
}
8988

@@ -118,7 +117,7 @@ func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) {
118117
t.Fatalf("err %s: expected mtime '%s' for %s, got '%s'", tc.Input, expected.String(), path, actual.String())
119118
}
120119
} else if actual.Unix() < 0 {
121-
t.Fatalf("err %s: expected mtime to be > 0, got '%s'", actual.String())
120+
t.Fatalf("err %s: expected mtime to be > 0, got '%s'", tc.Input, actual.String())
122121
}
123122

124123
}
@@ -127,7 +126,7 @@ func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) {
127126
}
128127
}
129128

130-
func testListDir(t testing.T, path string) []string {
129+
func testListDir(t testing.TB, path string) []string {
131130
var result []string
132131
err := filepath.Walk(path, func(sub string, info os.FileInfo, err error) error {
133132
if err != nil {
@@ -156,7 +155,7 @@ func testListDir(t testing.T, path string) []string {
156155
return result
157156
}
158157

159-
func testMD5(t testing.T, path string) string {
158+
func testMD5(t testing.TB, path string) string {
160159
f, err := os.Open(path)
161160
if err != nil {
162161
t.Fatalf("err: %s", err)

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ require (
1414
github.com/mattn/go-colorable v0.0.9 // indirect
1515
github.com/mattn/go-runewidth v0.0.4 // indirect
1616
github.com/mitchellh/go-homedir v1.1.0
17-
github.com/mitchellh/go-testing-interface v1.14.1
1817
github.com/ulikunitz/xz v0.5.10
1918
golang.org/x/net v0.34.0 // indirect
2019
golang.org/x/oauth2 v0.7.0

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,6 @@ github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcs
843843
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
844844
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
845845
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
846-
github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU=
847-
github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8=
848846
github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY=
849847
github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
850848
github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=

0 commit comments

Comments
 (0)