aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/bytes
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2011-07-14 14:39:40 -0700
committerRobert Griesemer <gri@golang.org>2011-07-14 14:39:40 -0700
commit90564a92565877d19e456694ac4e2ef205720432 (patch)
tree8cb7e9ba936b3721ed7e3120e95fa419859ea20f /src/pkg/bytes
parent58e19aa4cb8656cdb757172647dfcb028029185e (diff)
downloadgo-90564a92565877d19e456694ac4e2ef205720432.tar.xz
go/printer: changed max. number of newlines from 3 to 2
manual changes in src/pkg/go/printer, src/cmd/gofix/signal_test.go (cd src/cmd/gofix/testdata; gofmt -w *.in *.out) (cd src/pkg/go/printer; gotest -update) gofmt -w misc src runs all tests R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4715041
Diffstat (limited to 'src/pkg/bytes')
-rw-r--r--src/pkg/bytes/buffer_test.go17
-rw-r--r--src/pkg/bytes/bytes.go1
-rw-r--r--src/pkg/bytes/bytes_test.go2
3 files changed, 0 insertions, 20 deletions
diff --git a/src/pkg/bytes/buffer_test.go b/src/pkg/bytes/buffer_test.go
index 14f9501416..06d2a65c67 100644
--- a/src/pkg/bytes/buffer_test.go
+++ b/src/pkg/bytes/buffer_test.go
@@ -12,7 +12,6 @@ import (
"utf8"
)
-
const N = 10000 // make this bigger for a larger (and slower) test
var data string // test data for write tests
var bytes []byte // test data; same as data but as a slice.
@@ -47,7 +46,6 @@ func check(t *testing.T, testname string, buf *Buffer, s string) {
}
}
-
// Fill buf through n writes of string fus.
// The initial contents of buf corresponds to the string s;
// the result is the final contents of buf returned as a string.
@@ -67,7 +65,6 @@ func fillString(t *testing.T, testname string, buf *Buffer, s string, n int, fus
return s
}
-
// Fill buf through n writes of byte slice fub.
// The initial contents of buf corresponds to the string s;
// the result is the final contents of buf returned as a string.
@@ -87,19 +84,16 @@ func fillBytes(t *testing.T, testname string, buf *Buffer, s string, n int, fub
return s
}
-
func TestNewBuffer(t *testing.T) {
buf := NewBuffer(bytes)
check(t, "NewBuffer", buf, data)
}
-
func TestNewBufferString(t *testing.T) {
buf := NewBufferString(data)
check(t, "NewBufferString", buf, data)
}
-
// 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) {
@@ -120,7 +114,6 @@ func empty(t *testing.T, testname string, buf *Buffer, s string, fub []byte) {
check(t, testname+" (empty 4)", buf, "")
}
-
func TestBasicOperations(t *testing.T) {
var buf Buffer
@@ -175,7 +168,6 @@ func TestBasicOperations(t *testing.T) {
}
}
-
func TestLargeStringWrites(t *testing.T) {
var buf Buffer
limit := 30
@@ -189,7 +181,6 @@ func TestLargeStringWrites(t *testing.T) {
check(t, "TestLargeStringWrites (3)", &buf, "")
}
-
func TestLargeByteWrites(t *testing.T) {
var buf Buffer
limit := 30
@@ -203,7 +194,6 @@ func TestLargeByteWrites(t *testing.T) {
check(t, "TestLargeByteWrites (3)", &buf, "")
}
-
func TestLargeStringReads(t *testing.T) {
var buf Buffer
for i := 3; i < 30; i += 3 {
@@ -213,7 +203,6 @@ func TestLargeStringReads(t *testing.T) {
check(t, "TestLargeStringReads (3)", &buf, "")
}
-
func TestLargeByteReads(t *testing.T) {
var buf Buffer
for i := 3; i < 30; i += 3 {
@@ -223,7 +212,6 @@ func TestLargeByteReads(t *testing.T) {
check(t, "TestLargeByteReads (3)", &buf, "")
}
-
func TestMixedReadsAndWrites(t *testing.T) {
var buf Buffer
s := ""
@@ -243,7 +231,6 @@ func TestMixedReadsAndWrites(t *testing.T) {
empty(t, "TestMixedReadsAndWrites (2)", &buf, s, make([]byte, buf.Len()))
}
-
func TestNil(t *testing.T) {
var b *Buffer
if b.String() != "<nil>" {
@@ -251,7 +238,6 @@ func TestNil(t *testing.T) {
}
}
-
func TestReadFrom(t *testing.T) {
var buf Buffer
for i := 3; i < 30; i += 3 {
@@ -262,7 +248,6 @@ func TestReadFrom(t *testing.T) {
}
}
-
func TestWriteTo(t *testing.T) {
var buf Buffer
for i := 3; i < 30; i += 3 {
@@ -273,7 +258,6 @@ func TestWriteTo(t *testing.T) {
}
}
-
func TestRuneIO(t *testing.T) {
const NRune = 1000
// Built a test array while we write the data
@@ -323,7 +307,6 @@ func TestRuneIO(t *testing.T) {
}
}
-
func TestNext(t *testing.T) {
b := []byte{0, 1, 2, 3, 4}
tmp := make([]byte, 5)
diff --git a/src/pkg/bytes/bytes.go b/src/pkg/bytes/bytes.go
index 3cec60f96c..5119fce949 100644
--- a/src/pkg/bytes/bytes.go
+++ b/src/pkg/bytes/bytes.go
@@ -398,7 +398,6 @@ func ToTitleSpecial(_case unicode.SpecialCase, s []byte) []byte {
return Map(func(r int) int { return _case.ToTitle(r) }, s)
}
-
// isSeparator reports whether the rune could mark a word boundary.
// TODO: update when package unicode captures more of the properties.
func isSeparator(rune int) bool {
diff --git a/src/pkg/bytes/bytes_test.go b/src/pkg/bytes/bytes_test.go
index 7539353091..9444358a85 100644
--- a/src/pkg/bytes/bytes_test.go
+++ b/src/pkg/bytes/bytes_test.go
@@ -329,7 +329,6 @@ func TestExplode(t *testing.T) {
}
}
-
type SplitTest struct {
s string
sep string
@@ -662,7 +661,6 @@ func TestRunes(t *testing.T) {
}
}
-
type TrimTest struct {
f func([]byte, string) []byte
in, cutset, out string