summaryrefslogtreecommitdiff
path: root/src/pkg/xml/xml_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-12-15 15:41:46 -0800
committerRobert Griesemer <gri@golang.org>2009-12-15 15:41:46 -0800
commit3743fa38e180c74c51aae84eda082067e8e12523 (patch)
tree274d1d9bf832b7834ab60c65acdf945576271d14 /src/pkg/xml/xml_test.go
parent13ac778ef2f757c7cd636b4336a2bd6c8f403b43 (diff)
downloadgolang-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/xml/xml_test.go')
-rw-r--r--src/pkg/xml/xml_test.go42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/pkg/xml/xml_test.go b/src/pkg/xml/xml_test.go
index e689949af..43d418c1e 100644
--- a/src/pkg/xml/xml_test.go
+++ b/src/pkg/xml/xml_test.go
@@ -5,11 +5,11 @@
package xml
import (
- "io";
- "os";
- "reflect";
- "strings";
- "testing";
+ "io"
+ "os"
+ "reflect"
+ "strings"
+ "testing"
)
const testInput = `
@@ -146,8 +146,8 @@ var xmlInput = []string{
}
type stringReader struct {
- s string;
- off int;
+ s string
+ off int
}
func (r *stringReader) Read(b []byte) (n int, err os.Error) {
@@ -155,29 +155,29 @@ func (r *stringReader) Read(b []byte) (n int, err os.Error) {
return 0, os.EOF
}
for r.off < len(r.s) && n < len(b) {
- b[n] = r.s[r.off];
- n++;
- r.off++;
+ b[n] = r.s[r.off]
+ n++
+ r.off++
}
- return;
+ return
}
func (r *stringReader) ReadByte() (b byte, err os.Error) {
if r.off >= len(r.s) {
return 0, os.EOF
}
- b = r.s[r.off];
- r.off++;
- return;
+ b = r.s[r.off]
+ r.off++
+ return
}
-func StringReader(s string) io.Reader { return &stringReader{s, 0} }
+func StringReader(s string) io.Reader { return &stringReader{s, 0} }
func TestRawToken(t *testing.T) {
- p := NewParser(StringReader(testInput));
+ p := NewParser(StringReader(testInput))
for i, want := range rawTokens {
- have, err := p.RawToken();
+ have, err := p.RawToken()
if err != nil {
t.Fatalf("token %d: unexpected error: %s", i, err)
}
@@ -188,10 +188,10 @@ func TestRawToken(t *testing.T) {
}
func TestToken(t *testing.T) {
- p := NewParser(StringReader(testInput));
+ p := NewParser(StringReader(testInput))
for i, want := range cookedTokens {
- have, err := p.Token();
+ have, err := p.Token()
if err != nil {
t.Fatalf("token %d: unexpected error: %s", i, err)
}
@@ -203,8 +203,8 @@ func TestToken(t *testing.T) {
func TestSyntax(t *testing.T) {
for i := range xmlInput {
- p := NewParser(StringReader(xmlInput[i]));
- var err os.Error;
+ p := NewParser(StringReader(xmlInput[i]))
+ var err os.Error
for _, err = p.Token(); err == nil; _, err = p.Token() {
}
if _, ok := err.(SyntaxError); !ok {