Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
Remove unused testing helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuhei Kitagawa committed Sep 29, 2018
1 parent 6283f37 commit d29d929
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions testing_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package travis
import (
"fmt"
"path/filepath"
"reflect"
"runtime"
"testing"
)
Expand All @@ -21,29 +20,3 @@ func assert(tb testing.TB, condition bool, msg string, v ...interface{}) {
tb.FailNow()
}
}

// ok fails the test if an err is not nil.
func ok(tb testing.TB, err error) {
if err != nil {
_, file, line, _ := runtime.Caller(1)
fmt.Printf("\033[31m%s:%d: unexpected error: %s\033[39m\n\n", filepath.Base(file), line, err.Error())
tb.FailNow()
}
}

func notOk(tb testing.TB, err error) {
if err == nil {
_, file, line, _ := runtime.Caller(1)
fmt.Printf("\033[31m%s:%d: expected error but got nil instead\n\n", filepath.Base(file), line)
tb.FailNow()
}
}

// equals fails the test if exp is not equal to act.
func equals(tb testing.TB, exp, act interface{}) {
if !reflect.DeepEqual(exp, act) {
_, file, line, _ := runtime.Caller(1)
fmt.Printf("\033[31m%s:%d:\n\n\texp: %#v\n\n\tgot: %#v\033[39m\n\n", filepath.Base(file), line, exp, act)
tb.FailNow()
}
}

0 comments on commit d29d929

Please sign in to comment.