test: add zero boundary assertions to TestSafeInt8 and TestSafeUint16

Signed-off-by: aoright <102943475+aoright@users.noreply.github.com>
This commit is contained in:
aoright 2026-08-19 13:47:09 +08:00
parent dcaa4296d1
commit d075bf04cd

View File

@ -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))
}