diff options
author | Rob Pike <r@golang.org> | 2010-09-23 13:48:56 +1000 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2010-09-23 13:48:56 +1000 |
commit | 3401cadbfb57b48c5391b7196305fcd86981a4bb (patch) | |
tree | 4153d9b82a21c67a33a4746358e3e8724d877b38 /src/pkg/strconv | |
parent | bdf37fa0c88411ad4c2130fc879b73bd604821ac (diff) | |
download | go-3401cadbfb57b48c5391b7196305fcd86981a4bb.tar.gz |
tests: fix prints
- delete unnecessary newlines
- make sure formatted prints call the formatting routines
R=adg
CC=golang-dev
http://codereview.appspot.com/2225046
Diffstat (limited to 'src/pkg/strconv')
-rw-r--r-- | src/pkg/strconv/atof_test.go | 10 | ||||
-rw-r--r-- | src/pkg/strconv/atoi_test.go | 16 | ||||
-rw-r--r-- | src/pkg/strconv/decimal_test.go | 10 | ||||
-rw-r--r-- | src/pkg/strconv/fp_test.go | 2 | ||||
-rw-r--r-- | src/pkg/strconv/itoa_test.go | 24 |
5 files changed, 31 insertions, 31 deletions
diff --git a/src/pkg/strconv/atof_test.go b/src/pkg/strconv/atof_test.go index 0039a6e44..d59fc0d7b 100644 --- a/src/pkg/strconv/atof_test.go +++ b/src/pkg/strconv/atof_test.go @@ -112,14 +112,14 @@ func testAtof(t *testing.T, opt bool) { out, err := Atof64(test.in) outs := Ftoa64(out, 'g', -1) if outs != test.out || !reflect.DeepEqual(err, test.err) { - t.Errorf("Atof64(%v) = %v, %v want %v, %v\n", + t.Errorf("Atof64(%v) = %v, %v want %v, %v", test.in, out, err, test.out, test.err) } out, err = AtofN(test.in, 64) outs = FtoaN(out, 'g', -1, 64) if outs != test.out || !reflect.DeepEqual(err, test.err) { - t.Errorf("AtofN(%v, 64) = %v, %v want %v, %v\n", + t.Errorf("AtofN(%v, 64) = %v, %v want %v, %v", test.in, out, err, test.out, test.err) } @@ -127,7 +127,7 @@ func testAtof(t *testing.T, opt bool) { out32, err := Atof32(test.in) outs := Ftoa32(out32, 'g', -1) if outs != test.out || !reflect.DeepEqual(err, test.err) { - t.Errorf("Atof32(%v) = %v, %v want %v, %v # %v\n", + t.Errorf("Atof32(%v) = %v, %v want %v, %v # %v", test.in, out32, err, test.out, test.err, out) } @@ -135,7 +135,7 @@ func testAtof(t *testing.T, opt bool) { out32 = float32(out) outs = FtoaN(float64(out32), 'g', -1, 32) if outs != test.out || !reflect.DeepEqual(err, test.err) { - t.Errorf("AtofN(%v, 32) = %v, %v want %v, %v # %v\n", + t.Errorf("AtofN(%v, 32) = %v, %v want %v, %v # %v", test.in, out32, err, test.out, test.err, out) } } @@ -144,7 +144,7 @@ func testAtof(t *testing.T, opt bool) { outf, err := Atof(test.in) outs := Ftoa(outf, 'g', -1) if outs != test.out || !reflect.DeepEqual(err, test.err) { - t.Errorf("Ftoa(%v) = %v, %v want %v, %v # %v\n", + t.Errorf("Ftoa(%v) = %v, %v want %v, %v # %v", test.in, outf, err, test.out, test.err, out) } } diff --git a/src/pkg/strconv/atoi_test.go b/src/pkg/strconv/atoi_test.go index 7df930342..a914d70dd 100644 --- a/src/pkg/strconv/atoi_test.go +++ b/src/pkg/strconv/atoi_test.go @@ -193,7 +193,7 @@ func TestAtoui64(t *testing.T) { test := &atoui64tests[i] out, err := Atoui64(test.in) if test.out != out || !reflect.DeepEqual(test.err, err) { - t.Errorf("Atoui64(%q) = %v, %v want %v, %v\n", + t.Errorf("Atoui64(%q) = %v, %v want %v, %v", test.in, out, err, test.out, test.err) } } @@ -204,7 +204,7 @@ func TestBtoui64(t *testing.T) { test := &btoui64tests[i] out, err := Btoui64(test.in, 0) if test.out != out || !reflect.DeepEqual(test.err, err) { - t.Errorf("Btoui64(%q) = %v, %v want %v, %v\n", + t.Errorf("Btoui64(%q) = %v, %v want %v, %v", test.in, out, err, test.out, test.err) } } @@ -215,7 +215,7 @@ func TestAtoi64(t *testing.T) { test := &atoi64tests[i] out, err := Atoi64(test.in) if test.out != out || !reflect.DeepEqual(test.err, err) { - t.Errorf("Atoi64(%q) = %v, %v want %v, %v\n", + t.Errorf("Atoi64(%q) = %v, %v want %v, %v", test.in, out, err, test.out, test.err) } } @@ -226,7 +226,7 @@ func TestBtoi64(t *testing.T) { test := &btoi64tests[i] out, err := Btoi64(test.in, 0) if test.out != out || !reflect.DeepEqual(test.err, err) { - t.Errorf("Btoi64(%q) = %v, %v want %v, %v\n", + t.Errorf("Btoi64(%q) = %v, %v want %v, %v", test.in, out, err, test.out, test.err) } } @@ -239,7 +239,7 @@ func TestAtoui(t *testing.T) { test := &atoui32tests[i] out, err := Atoui(test.in) if test.out != uint32(out) || !reflect.DeepEqual(test.err, err) { - t.Errorf("Atoui(%q) = %v, %v want %v, %v\n", + t.Errorf("Atoui(%q) = %v, %v want %v, %v", test.in, out, err, test.out, test.err) } } @@ -248,7 +248,7 @@ func TestAtoui(t *testing.T) { test := &atoui64tests[i] out, err := Atoui(test.in) if test.out != uint64(out) || !reflect.DeepEqual(test.err, err) { - t.Errorf("Atoui(%q) = %v, %v want %v, %v\n", + t.Errorf("Atoui(%q) = %v, %v want %v, %v", test.in, out, err, test.out, test.err) } } @@ -262,7 +262,7 @@ func TestAtoi(t *testing.T) { test := &atoi32tests[i] out, err := Atoi(test.in) if test.out != int32(out) || !reflect.DeepEqual(test.err, err) { - t.Errorf("Atoi(%q) = %v, %v want %v, %v\n", + t.Errorf("Atoi(%q) = %v, %v want %v, %v", test.in, out, err, test.out, test.err) } } @@ -271,7 +271,7 @@ func TestAtoi(t *testing.T) { test := &atoi64tests[i] out, err := Atoi(test.in) if test.out != int64(out) || !reflect.DeepEqual(test.err, err) { - t.Errorf("Atoi(%q) = %v, %v want %v, %v\n", + t.Errorf("Atoi(%q) = %v, %v want %v, %v", test.in, out, err, test.out, test.err) } } diff --git a/src/pkg/strconv/decimal_test.go b/src/pkg/strconv/decimal_test.go index 5f73450cd..41d33f595 100644 --- a/src/pkg/strconv/decimal_test.go +++ b/src/pkg/strconv/decimal_test.go @@ -34,7 +34,7 @@ func TestDecimalShift(t *testing.T) { test := &shifttests[i] s := NewDecimal(test.i).Shift(test.shift).String() if s != test.out { - t.Errorf("Decimal %v << %v = %v, want %v\n", + t.Errorf("Decimal %v << %v = %v, want %v", test.i, test.shift, s, test.out) } } @@ -70,17 +70,17 @@ func TestDecimalRound(t *testing.T) { test := &roundtests[i] s := NewDecimal(test.i).RoundDown(test.nd).String() if s != test.down { - t.Errorf("Decimal %v RoundDown %d = %v, want %v\n", + t.Errorf("Decimal %v RoundDown %d = %v, want %v", test.i, test.nd, s, test.down) } s = NewDecimal(test.i).Round(test.nd).String() if s != test.round { - t.Errorf("Decimal %v Round %d = %v, want %v\n", + t.Errorf("Decimal %v Round %d = %v, want %v", test.i, test.nd, s, test.down) } s = NewDecimal(test.i).RoundUp(test.nd).String() if s != test.up { - t.Errorf("Decimal %v RoundUp %d = %v, want %v\n", + t.Errorf("Decimal %v RoundUp %d = %v, want %v", test.i, test.nd, s, test.up) } } @@ -110,7 +110,7 @@ func TestDecimalRoundedInteger(t *testing.T) { test := roundinttests[i] int := NewDecimal(test.i).Shift(test.shift).RoundedInteger() if int != test.int { - t.Errorf("Decimal %v >> %v RoundedInteger = %v, want %v\n", + t.Errorf("Decimal %v >> %v RoundedInteger = %v, want %v", test.i, test.shift, int, test.int) } } diff --git a/src/pkg/strconv/fp_test.go b/src/pkg/strconv/fp_test.go index 4cbadf316..305adcc0c 100644 --- a/src/pkg/strconv/fp_test.go +++ b/src/pkg/strconv/fp_test.go @@ -118,7 +118,7 @@ func TestFp(t *testing.T) { } a := strings.Split(line, " ", -1) if len(a) != 4 { - t.Error("testfp.txt:", lineno, ": wrong field count\n") + t.Error("testfp.txt:", lineno, ": wrong field count") continue } var s string diff --git a/src/pkg/strconv/itoa_test.go b/src/pkg/strconv/itoa_test.go index 039ef4446..8333e6c00 100644 --- a/src/pkg/strconv/itoa_test.go +++ b/src/pkg/strconv/itoa_test.go @@ -62,14 +62,14 @@ func TestItoa(t *testing.T) { for _, test := range itob64tests { s := Itob64(test.in, test.base) if s != test.out { - t.Errorf("Itob64(%v, %v) = %v want %v\n", + t.Errorf("Itob64(%v, %v) = %v want %v", test.in, test.base, s, test.out) } if test.in >= 0 { s := Uitob64(uint64(test.in), test.base) if s != test.out { - t.Errorf("Uitob64(%v, %v) = %v want %v\n", + t.Errorf("Uitob64(%v, %v) = %v want %v", test.in, test.base, s, test.out) } } @@ -77,14 +77,14 @@ func TestItoa(t *testing.T) { if int64(int(test.in)) == test.in { s := Itob(int(test.in), test.base) if s != test.out { - t.Errorf("Itob(%v, %v) = %v want %v\n", + t.Errorf("Itob(%v, %v) = %v want %v", test.in, test.base, s, test.out) } if test.in >= 0 { s := Uitob(uint(test.in), test.base) if s != test.out { - t.Errorf("Uitob(%v, %v) = %v want %v\n", + t.Errorf("Uitob(%v, %v) = %v want %v", test.in, test.base, s, test.out) } } @@ -93,14 +93,14 @@ func TestItoa(t *testing.T) { if test.base == 10 { s := Itoa64(test.in) if s != test.out { - t.Errorf("Itoa64(%v) = %v want %v\n", + t.Errorf("Itoa64(%v) = %v want %v", test.in, s, test.out) } if test.in >= 0 { s := Uitob64(uint64(test.in), test.base) if s != test.out { - t.Errorf("Uitob64(%v, %v) = %v want %v\n", + t.Errorf("Uitob64(%v, %v) = %v want %v", test.in, test.base, s, test.out) } } @@ -108,14 +108,14 @@ func TestItoa(t *testing.T) { if int64(int(test.in)) == test.in { s := Itoa(int(test.in)) if s != test.out { - t.Errorf("Itoa(%v) = %v want %v\n", + t.Errorf("Itoa(%v) = %v want %v", test.in, s, test.out) } if test.in >= 0 { s := Uitoa(uint(test.in)) if s != test.out { - t.Errorf("Uitoa(%v) = %v want %v\n", + t.Errorf("Uitoa(%v) = %v want %v", test.in, s, test.out) } } @@ -143,14 +143,14 @@ func TestUitoa(t *testing.T) { for _, test := range uitob64tests { s := Uitob64(test.in, test.base) if s != test.out { - t.Errorf("Uitob64(%v, %v) = %v want %v\n", + t.Errorf("Uitob64(%v, %v) = %v want %v", test.in, test.base, s, test.out) } if uint64(uint(test.in)) == test.in { s := Uitob(uint(test.in), test.base) if s != test.out { - t.Errorf("Uitob(%v, %v) = %v want %v\n", + t.Errorf("Uitob(%v, %v) = %v want %v", test.in, test.base, s, test.out) } } @@ -158,14 +158,14 @@ func TestUitoa(t *testing.T) { if test.base == 10 { s := Uitoa64(test.in) if s != test.out { - t.Errorf("Uitoa64(%v) = %v want %v\n", + t.Errorf("Uitoa64(%v) = %v want %v", test.in, s, test.out) } if uint64(uint(test.in)) == test.in { s := Uitoa(uint(test.in)) if s != test.out { - t.Errorf("Uitoa(%v) = %v want %v\n", + t.Errorf("Uitoa(%v) = %v want %v", test.in, s, test.out) } } |