mirror of
https://github.com/jimeh/go-golden.git
synced 2026-02-19 11:16:47 +00:00
wip: some more drastic refactoring
This commit is contained in:
30
testingt_test.go
Normal file
30
testingt_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package golden
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
type fakeTestingT struct {
|
||||
helper bool
|
||||
name string
|
||||
logs []string
|
||||
fatals []string
|
||||
}
|
||||
|
||||
func (m *fakeTestingT) Helper() {
|
||||
m.helper = true
|
||||
}
|
||||
|
||||
func (m *fakeTestingT) Fatalf(format string, args ...interface{}) {
|
||||
m.fatals = append(m.fatals, fmt.Sprintf(format, args...))
|
||||
runtime.Goexit()
|
||||
}
|
||||
|
||||
func (m *fakeTestingT) Logf(format string, args ...interface{}) {
|
||||
m.logs = append(m.logs, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func (m *fakeTestingT) Name() string {
|
||||
return m.name
|
||||
}
|
||||
Reference in New Issue
Block a user