From 7dcbf4f353a724091a6f1fc4e760753d3adecd2b Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Wed, 18 Jun 2014 10:57:18 -0700 Subject: [PATCH] =?utf8?q?fmt:=20include=20=C2=B1Inf=20and=20NaN=20in=20th?= =?utf8?q?e=20complex=20format=20test=20Just=20to=20be=20more=20thorough.?= =?utf8?q?=20No=20need=20to=20push=20this=20to=201.3;=20it's=20just=20a=20?= =?utf8?q?test=20change=20that=20worked=20without=20any=20changes=20to=20t?= =?utf8?q?he=20code=20being=20tested.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit LGTM=crawshaw R=golang-codereviews, crawshaw CC=golang-codereviews https://golang.org/cl/109080045 --- src/pkg/fmt/fmt_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pkg/fmt/fmt_test.go b/src/pkg/fmt/fmt_test.go index 430da628aa..ef8b2ad86e 100644 --- a/src/pkg/fmt/fmt_test.go +++ b/src/pkg/fmt/fmt_test.go @@ -676,7 +676,7 @@ func TestSprintf(t *testing.T) { // thing as if done by hand with two singleton prints. func TestComplexFormatting(t *testing.T) { var yesNo = []bool{true, false} - var signs = []float64{1, 0, -1} + var values = []float64{1, 0, -1, math.Inf(1), math.Inf(-1), math.NaN()} for _, plus := range yesNo { for _, zero := range yesNo { for _, space := range yesNo { @@ -701,10 +701,10 @@ func TestComplexFormatting(t *testing.T) { imagFmt += "+" imagFmt += "10.2" imagFmt += string(char) - for _, realSign := range signs { - for _, imagSign := range signs { - one := Sprintf(realFmt, complex(realSign, imagSign)) - two := Sprintf("("+realFmt+imagFmt+"i)", realSign, imagSign) + for _, realValue := range values { + for _, imagValue := range values { + one := Sprintf(realFmt, complex(realValue, imagValue)) + two := Sprintf("("+realFmt+imagFmt+"i)", realValue, imagValue) if one != two { t.Error(f, one, two) } -- 2.48.1