diff options
| author | Robert Griesemer <gri@golang.org> | 2009-11-09 21:09:34 -0800 | 
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2009-11-09 21:09:34 -0800 | 
| commit | ef50a171462c00444b6bf8d205ae8e97079ab2b9 (patch) | |
| tree | 19dba38f765c27e237474bcf2f29ea11733f2e0f /src/pkg/bytes/buffer_test.go | |
| parent | 14932a6e27718eb08f82f5ac4d39f6f70f6903dd (diff) | |
| download | golang-ef50a171462c00444b6bf8d205ae8e97079ab2b9.tar.gz | |
- replaced gofmt expression formatting algorithm with
  rsc's algorithm
- applied gofmt -w misc src
- partial CL (remaining files in other CLs)
R=rsc, r
http://go/go-review/1024040
Diffstat (limited to 'src/pkg/bytes/buffer_test.go')
| -rw-r--r-- | src/pkg/bytes/buffer_test.go | 30 | 
1 files changed, 15 insertions, 15 deletions
| diff --git a/src/pkg/bytes/buffer_test.go b/src/pkg/bytes/buffer_test.go index f566183be..e11eb5b1c 100644 --- a/src/pkg/bytes/buffer_test.go +++ b/src/pkg/bytes/buffer_test.go @@ -19,7 +19,7 @@ var bytes []byte	// test data; same as data but as a slice.  func init() {  	bytes = make([]byte, N);  	for i := 0; i < N; i++ { -		bytes[i] = 'a'+byte(i%26) +		bytes[i] = 'a' + byte(i%26)  	}  	data = string(bytes);  } @@ -50,17 +50,17 @@ func check(t *testing.T, testname string, buf *Buffer, s string) {  // The initial contents of buf corresponds to the string s;  // the result is the final contents of buf returned as a string.  func fillString(t *testing.T, testname string, buf *Buffer, s string, n int, fus string) string { -	check(t, testname + " (fill 1)", buf, s); +	check(t, testname+" (fill 1)", buf, s);  	for ; n > 0; n-- {  		m, err := buf.WriteString(fus);  		if m != len(fus) { -			t.Errorf(testname + " (fill 2): m == %d, expected %d\n", m, len(fus)) +			t.Errorf(testname+" (fill 2): m == %d, expected %d\n", m, len(fus))  		}  		if err != nil { -			t.Errorf(testname + " (fill 3): err should always be nil, found err == %s\n", err) +			t.Errorf(testname+" (fill 3): err should always be nil, found err == %s\n", err)  		}  		s += fus; -		check(t, testname + " (fill 4)", buf, s); +		check(t, testname+" (fill 4)", buf, s);  	}  	return s;  } @@ -70,17 +70,17 @@ func fillString(t *testing.T, testname string, buf *Buffer, s string, n int, fus  // The initial contents of buf corresponds to the string s;  // the result is the final contents of buf returned as a string.  func fillBytes(t *testing.T, testname string, buf *Buffer, s string, n int, fub []byte) string { -	check(t, testname + " (fill 1)", buf, s); +	check(t, testname+" (fill 1)", buf, s);  	for ; n > 0; n-- {  		m, err := buf.Write(fub);  		if m != len(fub) { -			t.Errorf(testname + " (fill 2): m == %d, expected %d\n", m, len(fub)) +			t.Errorf(testname+" (fill 2): m == %d, expected %d\n", m, len(fub))  		}  		if err != nil { -			t.Errorf(testname + " (fill 3): err should always be nil, found err == %s\n", err) +			t.Errorf(testname+" (fill 3): err should always be nil, found err == %s\n", err)  		}  		s += string(fub); -		check(t, testname + " (fill 4)", buf, s); +		check(t, testname+" (fill 4)", buf, s);  	}  	return s;  } @@ -101,7 +101,7 @@ func TestNewBufferString(t *testing.T) {  // Empty buf through repeated reads into fub.  // The initial contents of buf corresponds to the string s.  func empty(t *testing.T, testname string, buf *Buffer, s string, fub []byte) { -	check(t, testname + " (empty 1)", buf, s); +	check(t, testname+" (empty 1)", buf, s);  	for {  		n, err := buf.Read(fub); @@ -109,13 +109,13 @@ func empty(t *testing.T, testname string, buf *Buffer, s string, fub []byte) {  			break  		}  		if err != nil { -			t.Errorf(testname + " (empty 2): err should always be nil, found err == %s\n", err) +			t.Errorf(testname+" (empty 2): err should always be nil, found err == %s\n", err)  		}  		s = s[n:len(s)]; -		check(t, testname + " (empty 3)", buf, s); +		check(t, testname+" (empty 3)", buf, s);  	} -	check(t, testname + " (empty 4)", buf, ""); +	check(t, testname+" (empty 4)", buf, "");  } @@ -197,7 +197,7 @@ func TestLargeByteWrites(t *testing.T) {  func TestLargeStringReads(t *testing.T) {  	var buf Buffer;  	for i := 3; i < 30; i += 3 { -		s := fillString(t, "TestLargeReads (1)", &buf, "", 5, data[0 : len(data)/i]); +		s := fillString(t, "TestLargeReads (1)", &buf, "", 5, data[0:len(data)/i]);  		empty(t, "TestLargeReads (2)", &buf, s, make([]byte, len(data)));  	}  	check(t, "TestLargeStringReads (3)", &buf, ""); @@ -207,7 +207,7 @@ func TestLargeStringReads(t *testing.T) {  func TestLargeByteReads(t *testing.T) {  	var buf Buffer;  	for i := 3; i < 30; i += 3 { -		s := fillBytes(t, "TestLargeReads (1)", &buf, "", 5, bytes[0 : len(bytes)/i]); +		s := fillBytes(t, "TestLargeReads (1)", &buf, "", 5, bytes[0:len(bytes)/i]);  		empty(t, "TestLargeReads (2)", &buf, s, make([]byte, len(data)));  	}  	check(t, "TestLargeByteReads (3)", &buf, ""); | 
