File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ package test
1919import (
2020 "log"
2121 "os"
22- "testing"
2322)
2423
2524// -----------------------------------------------------------------------------
@@ -36,9 +35,16 @@ func Fatalf(format string, v ...any) {
3635
3736// -----------------------------------------------------------------------------
3837
38+ // testingT is an interface that abstracts *testing.T to decouple this package
39+ // from the testing package dependency.
40+ type testingT interface {
41+ // Errorf is equivalent to Logf followed by Fail.
42+ Errorf (format string , args ... any )
43+ }
44+
3945// Diff compares the dst and src byte slices.
4046// If they are different, it writes the dst to the outfile and logs the differences.
41- func Diff (t * testing. T , outfile string , dst , src []byte ) bool {
47+ func Diff (t testingT , outfile string , dst , src []byte ) bool {
4248 line := 1
4349 offs := 0 // line offset
4450 for i := 0 ; i < len (dst ) && i < len (src ); i ++ {
You can’t perform that action at this time.
0 commit comments