diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-08-10 21:05:17 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-08-12 13:26:32 +0200 |
commit | 9e571827055dedb46b78c5db3d17d6913f14870b (patch) | |
tree | f5f0108afe0c9385ff6dc27664943d9f719f57ad /common/math | |
parent | 6027ee11082d0b9d72de1d4d1980a702be294ad2 (diff) |
tests: Convert from testify to quicktest
Diffstat (limited to 'common/math')
-rw-r--r-- | common/math/math_test.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/common/math/math_test.go b/common/math/math_test.go index 613ac3073..a11701862 100644 --- a/common/math/math_test.go +++ b/common/math/math_test.go @@ -14,17 +14,16 @@ package math import ( - "fmt" "testing" - "github.com/alecthomas/assert" - "github.com/stretchr/testify/require" + qt "github.com/frankban/quicktest" ) func TestDoArithmetic(t *testing.T) { t.Parallel() + c := qt.New(t) - for i, test := range []struct { + for _, test := range []struct { a interface{} b interface{} op rune @@ -94,16 +93,14 @@ func TestDoArithmetic(t *testing.T) { {"foo", "bar", '-', false}, {3, 2, '%', false}, } { - errMsg := fmt.Sprintf("[%d] %v", i, test) - result, err := DoArithmetic(test.a, test.b, test.op) if b, ok := test.expect.(bool); ok && !b { - require.Error(t, err, errMsg) + c.Assert(err, qt.Not(qt.IsNil)) continue } - require.NoError(t, err, errMsg) - assert.Equal(t, test.expect, result, errMsg) + c.Assert(err, qt.IsNil) + c.Assert(test.expect, qt.Equals, result) } } |