1
0
mirror of https://github.com/golang/go synced 2024-11-16 22:54:47 -07:00

fmt: add uintptr test case

uintptr case was not covered, so add test.

Change-Id: I894e06cb7db250d5dc1f14293c0d5834bfb00b9a
GitHub-Last-Rev: 92f8301cb0
GitHub-Pull-Request: golang/go#56912
Reviewed-on: https://go-review.googlesource.com/c/go/+/452955
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
kijimaD 2022-11-23 07:09:31 +00:00 committed by Rob Pike
parent f89b39c0af
commit 7db54f1050

View File

@ -52,6 +52,7 @@ var (
uint16Val uint16
uint32Val uint32
uint64Val uint64
uintptrVal uintptr
float32Val float32
float64Val float64
stringVal string
@ -162,6 +163,7 @@ var scanTests = []ScanTest{
{"28\n", &uint16Val, uint16(28)},
{"29\n", &uint32Val, uint32(29)},
{"30\n", &uint64Val, uint64(30)},
{"31\n", &uintptrVal, uintptr(31)},
{"255\n", &uint8Val, uint8(255)},
{"32767\n", &int16Val, int16(32767)},
{"2.3\n", &float64Val, 2.3},
@ -247,6 +249,7 @@ var scanfTests = []ScanfTest{
{"%d", "74\n", &uint16Val, uint16(74)},
{"%d", "75\n", &uint32Val, uint32(75)},
{"%d", "76\n", &uint64Val, uint64(76)},
{"%d", "77\n", &uintptrVal, uintptr(77)},
{"%b", "1001001\n", &uintVal, uint(73)},
{"%b", "100_1001\n", &uintVal, uint(4)},
{"%o", "075\n", &uintVal, uint(075)},