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

Delta Between Two Patch Sets: utils/tailer/tailer_test.go

Issue 44540043: apiserver/logger: adding command for debug log
Left Patch Set: Created 11 years, 4 months ago
Right Patch Set: apiserver/logger: adding command for debug log Created 11 years, 2 months 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« state/apiserver/root.go ('K') | « utils/tailer/tailer.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2013 Canonical Ltd. 1 // Copyright 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package tailer_test 4 package tailer_test
5 5
6 import ( 6 import (
7 "bufio" 7 "bufio"
8 "bytes" 8 "bytes"
9 "fmt" 9 "fmt"
10 "io" 10 "io"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 "yankee yankee\n", 54 "yankee yankee\n",
55 "zulu zulu\n", 55 "zulu zulu\n",
56 } 56 }
57 57
58 var tests = []struct { 58 var tests = []struct {
59 description string 59 description string
60 data []string 60 data []string
61 initialLinesWritten int 61 initialLinesWritten int
62 initialLinesRequested int 62 initialLinesRequested int
63 bufferSize int 63 bufferSize int
64 » filter tailer.TailerFilterFunc 64 » filter tailer.FilterFunc
65 injector func(*tailer.Tailer, *readSeeker) func([]string) 65 injector func(*tailer.Tailer, *readSeeker) func([]string)
66 initialCollectedData []string 66 initialCollectedData []string
67 appendedCollectedData []string 67 appendedCollectedData []string
68 err string 68 err string
69 }{{ 69 }{{
70 description: "lines are longer than buffer size", 70 description: "lines are longer than buffer size",
71 data: []string{ 71 data: []string{
72 "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n", 72 "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz\n",
73 "0123456789012345678901234567890123456789012345678901\n", 73 "0123456789012345678901234567890123456789012345678901\n",
74 }, 74 },
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 } 498 }
499 if newPos < 0 { 499 if newPos < 0 {
500 return 0, fmt.Errorf("negative position: %d", newPos) 500 return 0, fmt.Errorf("negative position: %d", newPos)
501 } 501 }
502 if newPos >= 1<<31 { 502 if newPos >= 1<<31 {
503 return 0, fmt.Errorf("position out of range: %d", newPos) 503 return 0, fmt.Errorf("position out of range: %d", newPos)
504 } 504 }
505 r.pos = int(newPos) 505 r.pos = int(newPos)
506 return newPos, nil 506 return newPos, nil
507 } 507 }
LEFTRIGHT

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