Skip to content

Commit

Permalink
Forgot to stage poor mock_test
Browse files Browse the repository at this point in the history
  • Loading branch information
rentziass committed Mar 22, 2023
1 parent 331f24c commit 0b20ff8
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions mock_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package eventually_test

import (
"fmt"
"testing"
)

type test struct {
*testing.T
logs []string
failed bool
halted bool
}

func (t *test) Fail() {
t.failed = true
}

func (t *test) FailNow() {
t.failed = true
t.halted = true
}

func (t *test) Fatal(args ...interface{}) {
t.Log(args...)
t.FailNow()
}

func (t *test) Fatalf(format string, args ...interface{}) {
t.Logf(format, args...)
t.FailNow()
}

func (t *test) Error(args ...interface{}) {
t.Log(args...)
t.Fail()
}

func (t *test) Errorf(format string, args ...interface{}) {
t.Logf(format, args...)
t.Fail()
}

func (t *test) Log(args ...any) {
t.logs = append(t.logs, fmt.Sprintln(args...))
}

func (t *test) Logf(format string, args ...any) {
t.logs = append(t.logs, fmt.Sprintf(format, args...))
}

0 comments on commit 0b20ff8

Please sign in to comment.