@@ -14,9 +14,8 @@ import (
14
14
"runtime"
15
15
"sort"
16
16
"strings"
17
+ "testing"
17
18
"time"
18
-
19
- "github.com/mitchellh/go-testing-interface"
20
19
)
21
20
22
21
// TestDecompressCase is a single test case for testing decompressors
@@ -30,7 +29,7 @@ type TestDecompressCase struct {
30
29
}
31
30
32
31
// 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 ) {
34
33
t .Helper ()
35
34
36
35
for _ , tc := range cases {
@@ -83,7 +82,7 @@ func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) {
83
82
t .Fatalf ("err %s: expected mtime '%s' for %s, got '%s'" , tc .Input , expected .String (), dst , actual .String ())
84
83
}
85
84
} 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 ())
87
86
}
88
87
}
89
88
@@ -118,7 +117,7 @@ func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) {
118
117
t .Fatalf ("err %s: expected mtime '%s' for %s, got '%s'" , tc .Input , expected .String (), path , actual .String ())
119
118
}
120
119
} 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 ())
122
121
}
123
122
124
123
}
@@ -127,7 +126,7 @@ func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) {
127
126
}
128
127
}
129
128
130
- func testListDir (t testing.T , path string ) []string {
129
+ func testListDir (t testing.TB , path string ) []string {
131
130
var result []string
132
131
err := filepath .Walk (path , func (sub string , info os.FileInfo , err error ) error {
133
132
if err != nil {
@@ -156,7 +155,7 @@ func testListDir(t testing.T, path string) []string {
156
155
return result
157
156
}
158
157
159
- func testMD5 (t testing.T , path string ) string {
158
+ func testMD5 (t testing.TB , path string ) string {
160
159
f , err := os .Open (path )
161
160
if err != nil {
162
161
t .Fatalf ("err: %s" , err )
0 commit comments