From 3d1a81df1fbf1f912433d829530724ce9a40778f Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 11 May 2022 19:33:17 +0300 Subject: [PATCH] native: std.itoa uses lower-cased letters, fix #2476 --- pkg/core/native/std.go | 1 - pkg/core/native/std_test.go | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/core/native/std.go b/pkg/core/native/std.go index 26fc49115..04211b59a 100644 --- a/pkg/core/native/std.go +++ b/pkg/core/native/std.go @@ -238,7 +238,6 @@ func (s *Std) itoa(_ *interop.Context, args []stackitem.Item) stackitem.Item { if pad := bs[0] & 0xF8; pad == 0 || pad == 0xF8 { str = str[1:] } - str = strings.ToUpper(str) default: panic(ErrInvalidBase) } diff --git a/pkg/core/native/std_test.go b/pkg/core/native/std_test.go index 2817850e0..da56a4f90 100644 --- a/pkg/core/native/std_test.go +++ b/pkg/core/native/std_test.go @@ -35,9 +35,9 @@ func TestStdLibItoaAtoi(t *testing.T) { {big.NewInt(1), big.NewInt(16), "1"}, {big.NewInt(7), big.NewInt(16), "7"}, {big.NewInt(8), big.NewInt(16), "08"}, - {big.NewInt(65535), big.NewInt(16), "0FFFF"}, - {big.NewInt(15), big.NewInt(16), "0F"}, - {big.NewInt(-1), big.NewInt(16), "F"}, + {big.NewInt(65535), big.NewInt(16), "0ffff"}, + {big.NewInt(15), big.NewInt(16), "0f"}, + {big.NewInt(-1), big.NewInt(16), "f"}, } for _, tc := range testCases {