From d3e0584ca7a6c4dbd03cc1422189c8667c0bd180 Mon Sep 17 00:00:00 2001 From: Matt Jibson Date: Wed, 17 Oct 2018 13:50:15 -0400 Subject: [PATCH] Use []string for big int tests --- decimal_test.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/decimal_test.go b/decimal_test.go index 7a91953..1bc2b63 100644 --- a/decimal_test.go +++ b/decimal_test.go @@ -54,21 +54,18 @@ func newDecimal(t *testing.T, c *Context, s string) *Decimal { } func TestNewWithBigInt(t *testing.T) { - tests := []struct { - d string - b string - }{ - {d: "0", b: "0"}, - {d: "1", b: "1"}, - {d: "-1", b: "-1"}, + tests := []string{ + "0", + "1", + "-1", } for _, tc := range tests { - t.Run(tc.d, func(t *testing.T) { - expect, _, err := new(Decimal).SetString(tc.d) + t.Run(tc, func(t *testing.T) { + expect, _, err := new(Decimal).SetString(tc) if err != nil { t.Fatal(err) } - b, ok := new(big.Int).SetString(tc.b, 10) + b, ok := new(big.Int).SetString(tc, 10) if !ok { t.Fatal("bad bigint") }