From 7db54f1050b201948ab292312d0d59bc439d7b21 Mon Sep 17 00:00:00 2001 From: kijimaD Date: Wed, 23 Nov 2022 07:09:31 +0000 Subject: [PATCH] fmt: add uintptr test case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uintptr case was not covered, so add test. Change-Id: I894e06cb7db250d5dc1f14293c0d5834bfb00b9a GitHub-Last-Rev: 92f8301cb03b503500def0ae076fbf4de8ec448c GitHub-Pull-Request: golang/go#56912 Reviewed-on: https://go-review.googlesource.com/c/go/+/452955 Reviewed-by: Cherry Mui Reviewed-by: Martin Möhrmann Reviewed-by: Rob Pike Run-TryBot: Rob Pike TryBot-Result: Gopher Robot --- src/fmt/scan_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fmt/scan_test.go b/src/fmt/scan_test.go index da0dfd19a2d..e8c5769924d 100644 --- a/src/fmt/scan_test.go +++ b/src/fmt/scan_test.go @@ -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)},