Skip to content

Commit

Permalink
Add Int
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Nov 2, 2017
1 parent d96158d commit 43efda2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ func Error(t *testing.T, err, expected error, msgs ...interface{}) {
}
}

func Int(t *testing.T, output, expected int, msgs ...interface{}) {
if output != expected {
t.Errorf("%s%s output: %d\nexpected: %d\n", trace(), message(msgs...), output, expected)
}
}

func Float(t *testing.T, output, expected float64, msgs ...interface{}) {
if math.Abs(output-expected) > 1e-10 {
t.Errorf("%s%s output: %f\nexpected: %f\n", trace(), message(msgs...), output, expected)
Expand Down

0 comments on commit 43efda2

Please sign in to comment.