coverage goal is 70% by the end of the night.
This commit is contained in:
parent
95d0bcca4b
commit
54f3bd4d3a
4 changed files with 77 additions and 1 deletions
|
|
@ -28,11 +28,31 @@ func TestTimeValueFormatterWithFormat(t *testing.T) {
|
|||
assert.Equal(s, sdf)
|
||||
}
|
||||
|
||||
func TestFloatValueFormatter(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
assert.Equal("1234.00", FloatValueFormatter(1234.00))
|
||||
}
|
||||
|
||||
func TestFloatValueFormatterWithFloat32Input(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
assert.Equal("1234.00", FloatValueFormatter(float32(1234.00)))
|
||||
}
|
||||
|
||||
func TestFloatValueFormatterWithIntegerInput(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
assert.Equal("1234.00", FloatValueFormatter(1234))
|
||||
}
|
||||
|
||||
func TestFloatValueFormatterWithInt64Input(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
assert.Equal("1234.00", FloatValueFormatter(int64(1234)))
|
||||
}
|
||||
|
||||
func TestFloatValueFormatterWithFormat(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
v := 123.456
|
||||
sv := FloatValueFormatterWithFormat(v, "%.3f")
|
||||
assert.Equal("123.456", sv)
|
||||
assert.Equal("", FloatValueFormatterWithFormat(123, "%.3f"))
|
||||
assert.Equal("123.000", FloatValueFormatterWithFormat(123, "%.3f"))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue