Skip to content

Commit

Permalink
Remove assert.True for a subtest
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr Samylkin committed Mar 18, 2017
1 parent 7b5f686 commit 9a7fe68
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions config/decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,10 @@ func TestNumericConversion(t *testing.T) {

for from, provider := range providers {
for to, test := range conversions {
assert.True(t, t.Run(
fmt.Sprintf("From %q to %q", from, to),
t.Run(fmt.Sprintf("From %q to %q", from, to),
func(t *testing.T) {
test(provider, t)
}),
)
})
}
}
}
Expand Down Expand Up @@ -184,12 +182,12 @@ func TestNumericOverflows(t *testing.T) {
}

for to, f := range conversions {
assert.True(t, t.Run(fmt.Sprintf("%q overflow", to), func(t *testing.T) {
t.Run(fmt.Sprintf("%q overflow", to), func(t *testing.T) {
err := f(p)
require.Error(t, err)
assert.Contains(t, err.Error(), fmt.Sprintf(`can't convert %q`, fmt.Sprint(math.MaxFloat64)))
assert.Contains(t, err.Error(), to)
}))
})
}
}

Expand Down Expand Up @@ -224,11 +222,11 @@ func TestUnsignedNumericDecodingNegatives(t *testing.T) {
}

for to, f := range conversions {
assert.True(t, t.Run(fmt.Sprintf("%q convert negative", to), func(t *testing.T) {
t.Run(fmt.Sprintf("%q convert negative", to), func(t *testing.T) {
err := f(p)
require.Error(t, err)
assert.Contains(t, fmt.Sprintf("can't convert \"-1\" to unsigned integer type %q", to), err.Error())
}))
})
}
}

Expand Down

0 comments on commit 9a7fe68

Please sign in to comment.