diff options
| author | Robert Griesemer <gri@golang.org> | 2009-12-15 15:35:38 -0800 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2009-12-15 15:35:38 -0800 |
| commit | e4bd81f903362d998f7bfc02095935408aff0bc5 (patch) | |
| tree | 05f75a90e239d33be427da4f9c5596d2fcb3dc96 /src/pkg/io/io_test.go | |
| parent | d9527dd16f72598b54a64550607bf892efa12384 (diff) | |
| download | golang-e4bd81f903362d998f7bfc02095935408aff0bc5.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
3rd set of files.
R=rsc
CC=golang-dev
http://codereview.appspot.com/180048
Diffstat (limited to 'src/pkg/io/io_test.go')
| -rw-r--r-- | src/pkg/io/io_test.go | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/pkg/io/io_test.go b/src/pkg/io/io_test.go index 571712031..4ad1e5951 100644 --- a/src/pkg/io/io_test.go +++ b/src/pkg/io/io_test.go @@ -5,75 +5,75 @@ package io_test import ( - "bytes"; - . "io"; - "testing"; + "bytes" + . "io" + "testing" ) // An version of bytes.Buffer without ReadFrom and WriteTo type Buffer struct { - bytes.Buffer; - ReaderFrom; // conflicts with and hides bytes.Buffer's ReaderFrom. - WriterTo; // conflicts with and hides bytes.Buffer's WriterTo. + bytes.Buffer + ReaderFrom // conflicts with and hides bytes.Buffer's ReaderFrom. + WriterTo // conflicts with and hides bytes.Buffer's WriterTo. } // Simple tests, primarily to verify the ReadFrom and WriteTo callouts inside Copy and Copyn. func TestCopy(t *testing.T) { - rb := new(Buffer); - wb := new(Buffer); - rb.WriteString("hello, world."); - Copy(wb, rb); + rb := new(Buffer) + wb := new(Buffer) + rb.WriteString("hello, world.") + Copy(wb, rb) if wb.String() != "hello, world." { t.Errorf("Copy did not work properly") } } func TestCopyReadFrom(t *testing.T) { - rb := new(Buffer); - wb := new(bytes.Buffer); // implements ReadFrom. - rb.WriteString("hello, world."); - Copy(wb, rb); + rb := new(Buffer) + wb := new(bytes.Buffer) // implements ReadFrom. + rb.WriteString("hello, world.") + Copy(wb, rb) if wb.String() != "hello, world." { t.Errorf("Copy did not work properly") } } func TestCopyWriteTo(t *testing.T) { - rb := new(bytes.Buffer); // implements WriteTo. - wb := new(Buffer); - rb.WriteString("hello, world."); - Copy(wb, rb); + rb := new(bytes.Buffer) // implements WriteTo. + wb := new(Buffer) + rb.WriteString("hello, world.") + Copy(wb, rb) if wb.String() != "hello, world." { t.Errorf("Copy did not work properly") } } func TestCopyn(t *testing.T) { - rb := new(Buffer); - wb := new(Buffer); - rb.WriteString("hello, world."); - Copyn(wb, rb, 5); + rb := new(Buffer) + wb := new(Buffer) + rb.WriteString("hello, world.") + Copyn(wb, rb, 5) if wb.String() != "hello" { t.Errorf("Copyn did not work properly") } } func TestCopynReadFrom(t *testing.T) { - rb := new(Buffer); - wb := new(bytes.Buffer); // implements ReadFrom. - rb.WriteString("hello"); - Copyn(wb, rb, 5); + rb := new(Buffer) + wb := new(bytes.Buffer) // implements ReadFrom. + rb.WriteString("hello") + Copyn(wb, rb, 5) if wb.String() != "hello" { t.Errorf("Copyn did not work properly") } } func TestCopynWriteTo(t *testing.T) { - rb := new(bytes.Buffer); // implements WriteTo. - wb := new(Buffer); - rb.WriteString("hello, world."); - Copyn(wb, rb, 5); + rb := new(bytes.Buffer) // implements WriteTo. + wb := new(Buffer) + rb.WriteString("hello, world.") + Copyn(wb, rb, 5) if wb.String() != "hello" { t.Errorf("Copyn did not work properly") } |
