native: std.itoa uses lower-cased letters, fix #2476

This commit is contained in:
Roman Khimov 2022-05-11 19:33:17 +03:00
parent 711e21709f
commit 3d1a81df1f
2 changed files with 3 additions and 4 deletions

View file

@ -238,7 +238,6 @@ func (s *Std) itoa(_ *interop.Context, args []stackitem.Item) stackitem.Item {
if pad := bs[0] & 0xF8; pad == 0 || pad == 0xF8 { if pad := bs[0] & 0xF8; pad == 0 || pad == 0xF8 {
str = str[1:] str = str[1:]
} }
str = strings.ToUpper(str)
default: default:
panic(ErrInvalidBase) panic(ErrInvalidBase)
} }

View file

@ -35,9 +35,9 @@ func TestStdLibItoaAtoi(t *testing.T) {
{big.NewInt(1), big.NewInt(16), "1"}, {big.NewInt(1), big.NewInt(16), "1"},
{big.NewInt(7), big.NewInt(16), "7"}, {big.NewInt(7), big.NewInt(16), "7"},
{big.NewInt(8), big.NewInt(16), "08"}, {big.NewInt(8), big.NewInt(16), "08"},
{big.NewInt(65535), big.NewInt(16), "0FFFF"}, {big.NewInt(65535), big.NewInt(16), "0ffff"},
{big.NewInt(15), big.NewInt(16), "0F"}, {big.NewInt(15), big.NewInt(16), "0f"},
{big.NewInt(-1), big.NewInt(16), "F"}, {big.NewInt(-1), big.NewInt(16), "f"},
} }
for _, tc := range testCases { for _, tc := range testCases {