From 16051923d637b5c95eb42935c9c579402a8b2685 Mon Sep 17 00:00:00 2001 From: ganeshvanahalli Date: Tue, 5 Sep 2023 11:54:35 -0500 Subject: [PATCH] fix hex-based inputs in TestUnMarshalHexOrDecimal64 --- common/math/integer_test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/common/math/integer_test.go b/common/math/integer_test.go index 50ac8e4fcc..209331f25a 100644 --- a/common/math/integer_test.go +++ b/common/math/integer_test.go @@ -136,11 +136,11 @@ var ( // invalid encoding {input: "", wantErr: true}, {input: "null", wantErr: true}, - {input: `"0x"`, wantErr: true}, - {input: `"0xfffffffffffffffff"`, wantErr: true}, + {input: "\"0x\"", wantErr: true}, + {input: "\"0xfffffffffffffffff\"", wantErr: true}, {input: `"1ab"`, wantErr: true}, - {input: `"0xx"`, wantErr: true}, - {input: `"0x1zz01"`, wantErr: true}, + {input: "\"xx\"", wantErr: true}, + {input: "\"0x1zz01\"", wantErr: true}, // valid encoding {input: `""`, want: uint64(0)}, @@ -149,12 +149,12 @@ var ( {input: `"100"`, want: uint64(100)}, {input: `"12344678"`, want: uint64(12344678)}, {input: `"1111111111111111"`, want: uint64(1111111111111111)}, - {input: `"0x0"`, want: uint64(0)}, - {input: `"0x2"`, want: uint64(0x2)}, - {input: `"0x2F2"`, want: uint64(0x2f2)}, - {input: `"0x1122aaff"`, want: uint64(0x1122aaff)}, - {input: `"0xbbb"`, want: uint64(0xbbb)}, - {input: `"0xffffffffffffffff"`, want: uint64(0xffffffffffffffff)}, + {input: "\"0x0\"", want: uint64(0)}, + {input: "\"0x2\"", want: uint64(0x2)}, + {input: "\"0x2F2\"", want: uint64(0x2f2)}, + {input: "\"0x1122aaff\"", want: uint64(0x1122aaff)}, + {input: "\"0xbbb\"", want: uint64(0xbbb)}, + {input: "\"0xffffffffffffffff\"", want: uint64(0xffffffffffffffff)}, } )