mirror of
https://github.com/gin-gonic/gin.git
synced 2026-11-23 03:23:36 +08:00
test: add zero boundary assertions to TestSafeInt8 and TestSafeUint16
Signed-off-by: aoright <102943475+aoright@users.noreply.github.com>
This commit is contained in:
parent
dcaa4296d1
commit
d075bf04cd
@ -163,11 +163,13 @@ func TestIsASCII(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSafeInt8(t *testing.T) {
|
||||
assert.Equal(t, int8(0), safeInt8(0))
|
||||
assert.Equal(t, int8(100), safeInt8(100))
|
||||
assert.Equal(t, int8(math.MaxInt8), safeInt8(int(math.MaxInt8)+123))
|
||||
}
|
||||
|
||||
func TestSafeUint16(t *testing.T) {
|
||||
assert.Equal(t, uint16(0), safeUint16(0))
|
||||
assert.Equal(t, uint16(100), safeUint16(100))
|
||||
assert.Equal(t, uint16(math.MaxUint16), safeUint16(int(math.MaxUint16)+123))
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user