test: add test for util
This commit is contained in:
parent
d080d568cd
commit
cc6a1832fe
1 changed files with 8 additions and 0 deletions
|
|
@ -113,3 +113,11 @@ func TestReverseSlice(t *testing.T) {
|
||||||
1,
|
1,
|
||||||
}, numbers)
|
}, numbers)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestConvertPercent(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
|
||||||
|
assert.Equal(-1.0, convertPercent("1"))
|
||||||
|
assert.Equal(-1.0, convertPercent("a%"))
|
||||||
|
assert.Equal(0.1, convertPercent("10%"))
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue