Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1193)

Side by Side Diff: src/pkg/bufio/bufio_test.go

Issue 91840044: code review 91840044: all: spelling tweaks, A-G (Closed)
Patch Set: diff -r 46ac9e6796a3 https://code.google.com/p/go Created 11 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/archive/tar/reader_test.go ('k') | src/pkg/bufio/scan.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package bufio_test 5 package bufio_test
6 6
7 import ( 7 import (
8 . "bufio" 8 . "bufio"
9 "bytes" 9 "bytes"
10 "errors" 10 "errors"
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 } 342 }
343 } 343 }
344 // Test that we cannot unread any further. 344 // Test that we cannot unread any further.
345 if err := r.UnreadByte(); err == nil { 345 if err := r.UnreadByte(); err == nil {
346 t.Errorf("n = %d: expected error on UnreadByte", n) 346 t.Errorf("n = %d: expected error on UnreadByte", n)
347 } 347 }
348 } 348 }
349 } 349 }
350 350
351 func TestUnreadByteOthers(t *testing.T) { 351 func TestUnreadByteOthers(t *testing.T) {
352 » // A list of readers to use in conjuction with UnreadByte. 352 » // A list of readers to use in conjunction with UnreadByte.
353 var readers = []func(*Reader, byte) ([]byte, error){ 353 var readers = []func(*Reader, byte) ([]byte, error){
354 (*Reader).ReadBytes, 354 (*Reader).ReadBytes,
355 (*Reader).ReadSlice, 355 (*Reader).ReadSlice,
356 func(r *Reader, delim byte) ([]byte, error) { 356 func(r *Reader, delim byte) ([]byte, error) {
357 data, err := r.ReadString(delim) 357 data, err := r.ReadString(delim)
358 return []byte(data), err 358 return []byte(data), err
359 }, 359 },
360 // ReadLine doesn't fit the data/pattern easily 360 // ReadLine doesn't fit the data/pattern easily
361 // so we leave it out. It should be covered via 361 // so we leave it out. It should be covered via
362 // the ReadSlice test since ReadLine simply calls 362 // the ReadSlice test since ReadLine simply calls
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 1408
1409 func BenchmarkWriterFlush(b *testing.B) { 1409 func BenchmarkWriterFlush(b *testing.B) {
1410 b.ReportAllocs() 1410 b.ReportAllocs()
1411 bw := NewWriter(ioutil.Discard) 1411 bw := NewWriter(ioutil.Discard)
1412 str := strings.Repeat("x", 50) 1412 str := strings.Repeat("x", 50)
1413 for i := 0; i < b.N; i++ { 1413 for i := 0; i < b.N; i++ {
1414 bw.WriteString(str) 1414 bw.WriteString(str)
1415 bw.Flush() 1415 bw.Flush()
1416 } 1416 }
1417 } 1417 }
OLDNEW
« no previous file with comments | « src/pkg/archive/tar/reader_test.go ('k') | src/pkg/bufio/scan.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b