@@ -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 )
0 commit comments