diff options
| author | Robert Griesemer <gri@golang.org> | 2009-12-15 15:41:46 -0800 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2009-12-15 15:41:46 -0800 |
| commit | 3743fa38e180c74c51aae84eda082067e8e12523 (patch) | |
| tree | 274d1d9bf832b7834ab60c65acdf945576271d14 /src/pkg/time/time_test.go | |
| parent | 13ac778ef2f757c7cd636b4336a2bd6c8f403b43 (diff) | |
| download | golang-3743fa38e180c74c51aae84eda082067e8e12523.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
5th and last set of files.
R=rsc
CC=golang-dev
http://codereview.appspot.com/180050
Diffstat (limited to 'src/pkg/time/time_test.go')
| -rw-r--r-- | src/pkg/time/time_test.go | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/pkg/time/time_test.go b/src/pkg/time/time_test.go index 88b16ee26..23040d8ed 100644 --- a/src/pkg/time/time_test.go +++ b/src/pkg/time/time_test.go @@ -5,10 +5,10 @@ package time_test import ( - "os"; - "testing"; - "testing/quick"; - . "time"; + "os" + "testing" + "testing/quick" + . "time" ) func init() { @@ -19,8 +19,8 @@ func init() { } type TimeTest struct { - seconds int64; - golden Time; + seconds int64 + golden Time } var utctests = []TimeTest{ @@ -55,42 +55,42 @@ func same(t, u *Time) bool { func TestSecondsToUTC(t *testing.T) { for i := 0; i < len(utctests); i++ { - sec := utctests[i].seconds; - golden := &utctests[i].golden; - tm := SecondsToUTC(sec); - newsec := tm.Seconds(); + sec := utctests[i].seconds + golden := &utctests[i].golden + tm := SecondsToUTC(sec) + newsec := tm.Seconds() if newsec != sec { t.Errorf("SecondsToUTC(%d).Seconds() = %d", sec, newsec) } if !same(tm, golden) { - t.Errorf("SecondsToUTC(%d):", sec); - t.Errorf(" want=%+v", *golden); - t.Errorf(" have=%+v", *tm); + t.Errorf("SecondsToUTC(%d):", sec) + t.Errorf(" want=%+v", *golden) + t.Errorf(" have=%+v", *tm) } } } func TestSecondsToLocalTime(t *testing.T) { for i := 0; i < len(localtests); i++ { - sec := localtests[i].seconds; - golden := &localtests[i].golden; - tm := SecondsToLocalTime(sec); - newsec := tm.Seconds(); + sec := localtests[i].seconds + golden := &localtests[i].golden + tm := SecondsToLocalTime(sec) + newsec := tm.Seconds() if newsec != sec { t.Errorf("SecondsToLocalTime(%d).Seconds() = %d", sec, newsec) } if !same(tm, golden) { - t.Errorf("SecondsToLocalTime(%d):", sec); - t.Errorf(" want=%+v", *golden); - t.Errorf(" have=%+v", *tm); + t.Errorf("SecondsToLocalTime(%d):", sec) + t.Errorf(" want=%+v", *golden) + t.Errorf(" have=%+v", *tm) } } } func TestSecondsToUTCAndBack(t *testing.T) { - f := func(sec int64) bool { return SecondsToUTC(sec).Seconds() == sec }; - f32 := func(sec int32) bool { return f(int64(sec)) }; - cfg := &quick.Config{MaxCount: 10000}; + f := func(sec int64) bool { return SecondsToUTC(sec).Seconds() == sec } + f32 := func(sec int32) bool { return f(int64(sec)) } + cfg := &quick.Config{MaxCount: 10000} // Try a reasonable date first, then the huge ones. if err := quick.Check(f32, cfg); err != nil { |
