summaryrefslogtreecommitdiff
path: root/src/pkg/strconv/decimal_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-12-15 15:40:16 -0800
committerRobert Griesemer <gri@golang.org>2009-12-15 15:40:16 -0800
commit13ac778ef2f757c7cd636b4336a2bd6c8f403b43 (patch)
tree28b6ebc4aa762e38c45f4b0b69d3aee472ed4c3c /src/pkg/strconv/decimal_test.go
parente4bd81f903362d998f7bfc02095935408aff0bc5 (diff)
downloadgolang-13ac778ef2f757c7cd636b4336a2bd6c8f403b43.tar.gz
1) Change default gofmt default settings for
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 4th set of files. R=rsc CC=golang-dev http://codereview.appspot.com/180049
Diffstat (limited to 'src/pkg/strconv/decimal_test.go')
-rw-r--r--src/pkg/strconv/decimal_test.go40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/pkg/strconv/decimal_test.go b/src/pkg/strconv/decimal_test.go
index 9e67aa4c3..5f73450cd 100644
--- a/src/pkg/strconv/decimal_test.go
+++ b/src/pkg/strconv/decimal_test.go
@@ -5,14 +5,14 @@
package strconv_test
import (
- . "strconv";
- "testing";
+ . "strconv"
+ "testing"
)
type shiftTest struct {
- i uint64;
- shift int;
- out string;
+ i uint64
+ shift int
+ out string
}
var shifttests = []shiftTest{
@@ -31,8 +31,8 @@ var shifttests = []shiftTest{
func TestDecimalShift(t *testing.T) {
for i := 0; i < len(shifttests); i++ {
- test := &shifttests[i];
- s := NewDecimal(test.i).Shift(test.shift).String();
+ test := &shifttests[i]
+ s := NewDecimal(test.i).Shift(test.shift).String()
if s != test.out {
t.Errorf("Decimal %v << %v = %v, want %v\n",
test.i, test.shift, s, test.out)
@@ -41,10 +41,10 @@ func TestDecimalShift(t *testing.T) {
}
type roundTest struct {
- i uint64;
- nd int;
- down, round, up string;
- int uint64;
+ i uint64
+ nd int
+ down, round, up string
+ int uint64
}
var roundtests = []roundTest{
@@ -67,18 +67,18 @@ var roundtests = []roundTest{
func TestDecimalRound(t *testing.T) {
for i := 0; i < len(roundtests); i++ {
- test := &roundtests[i];
- s := NewDecimal(test.i).RoundDown(test.nd).String();
+ 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",
test.i, test.nd, s, test.down)
}
- s = NewDecimal(test.i).Round(test.nd).String();
+ s = NewDecimal(test.i).Round(test.nd).String()
if s != test.round {
t.Errorf("Decimal %v Round %d = %v, want %v\n",
test.i, test.nd, s, test.down)
}
- s = NewDecimal(test.i).RoundUp(test.nd).String();
+ s = NewDecimal(test.i).RoundUp(test.nd).String()
if s != test.up {
t.Errorf("Decimal %v RoundUp %d = %v, want %v\n",
test.i, test.nd, s, test.up)
@@ -87,9 +87,9 @@ func TestDecimalRound(t *testing.T) {
}
type roundIntTest struct {
- i uint64;
- shift int;
- int uint64;
+ i uint64
+ shift int
+ int uint64
}
var roundinttests = []roundIntTest{
@@ -107,8 +107,8 @@ var roundinttests = []roundIntTest{
func TestDecimalRoundedInteger(t *testing.T) {
for i := 0; i < len(roundinttests); i++ {
- test := roundinttests[i];
- int := NewDecimal(test.i).Shift(test.shift).RoundedInteger();
+ 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",
test.i, test.shift, int, test.int)