diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2016-01-02 22:34:41 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2016-01-02 22:34:41 -0700 |
commit | 34a0fa5307f7562980fb8e7ff4723f7987edf49b (patch) | |
tree | 26a01c0d5a3da53f45c7f54062c3af11479c4a2f /bolt_test.go | |
parent | Merge pull request #474 from elithrar/patch-1 (diff) | |
parent | test suite refactoring (diff) | |
download | dedo-34a0fa5307f7562980fb8e7ff4723f7987edf49b.tar.gz dedo-34a0fa5307f7562980fb8e7ff4723f7987edf49b.tar.xz |
Merge pull request #477 from benbjohnson/testing
Test suite refactoring
Diffstat (limited to 'bolt_test.go')
-rw-r--r-- | bolt_test.go | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/bolt_test.go b/bolt_test.go deleted file mode 100644 index b7bea1f..0000000 --- a/bolt_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package bolt_test - -import ( - "fmt" - "path/filepath" - "reflect" - "runtime" - "testing" -) - -// assert fails the test if the condition is false. -func assert(tb testing.TB, condition bool, msg string, v ...interface{}) { - if !condition { - _, file, line, _ := runtime.Caller(1) - fmt.Printf("\033[31m%s:%d: "+msg+"\033[39m\n\n", append([]interface{}{filepath.Base(file), line}, v...)...) - 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() - } -} - -// 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() - } -} |