diff options
Diffstat (limited to 'common/hexutil/hexutil_test.go')
-rw-r--r-- | common/hexutil/hexutil_test.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/common/hexutil/hexutil_test.go b/common/hexutil/hexutil_test.go index d18f08833..6a92a385c 100644 --- a/common/hexutil/hexutil_test.go +++ b/common/hexutil/hexutil_test.go @@ -28,9 +28,10 @@ type marshalTest struct { } type unmarshalTest struct { - input string - want interface{} - wantErr error + input string + want interface{} + wantErr error // if set, decoding must fail on any platform + wantErr32bit error // if set, decoding must fail on 32bit platforms (used for Uint tests) } var ( @@ -55,6 +56,13 @@ var ( {uint64(0x1122334455667788), "0x1122334455667788"}, } + encodeUintTests = []marshalTest{ + {uint(0), "0x0"}, + {uint(1), "0x1"}, + {uint(0xff), "0xff"}, + {uint(0x11223344), "0x11223344"}, + } + decodeBytesTests = []unmarshalTest{ // invalid {input: ``, wantErr: ErrEmptyString}, |