Skip to content

Commit

Permalink
test: fix coercers test for float64
Browse files Browse the repository at this point in the history
  • Loading branch information
Oudwins committed Sep 9, 2024
1 parent c420534 commit e794ae4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions conf/Coercers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,16 @@ func TestFloat64Coercer(t *testing.T) {
{input: 123, want: 123.00},
{input: "123", want: 123.00},
{input: 1.23, want: 1.23},
{input: true, want: 1.00},
{input: "x", err: true},
}

for _, test := range tests {
f, err = Coercers.Int(test.input)
f, err = Coercers.Float64(test.input)
if test.err {
assert.NotNil(t, err)
} else {
assert.Nil(t, err)
assert.Equal(t, test.want, f.(int))
assert.Equal(t, test.want, f.(float64))
}
}
}
Expand Down

0 comments on commit e794ae4

Please sign in to comment.