push
github
31 of 58 new or added lines in 4 files covered. (53.45%)
3 existing lines in 1 file now uncovered.4454 of 5621 relevant lines covered (79.24%)
3.55 hits per line
1 |
package testutil
|
|
2 |
|
|
3 |
import (
|
|
4 |
"bytes"
|
|
5 |
"fmt"
|
|
6 |
) |
|
7 |
|
|
8 |
// Buffer wrap and extends the bytes.Buffer
|
|
9 |
type Buffer struct { |
|
10 |
bytes.Buffer |
|
11 |
} |
|
12 |
|
|
13 |
// NewBuffer instance
|
|
NEW
|
func NewBuffer() *Buffer {
|
× |
NEW
|
return &Buffer{}
|
× |
NEW
|
} |
× |
17 |
|
|
18 |
// WriteString rewrite
|
|
NEW
|
func (b *Buffer) WriteString(ss ...string) { |
× |
NEW
|
for _, s := range ss { |
× |
NEW
|
_, _ = b.Buffer.WriteString(s) |
× |
NEW
|
} |
× |
23 |
} |
|
24 |
|
|
25 |
// WriteAny method
|
|
NEW
|
func (b *Buffer) WriteAny(vs ...interface{}) { |
× |
NEW
|
for _, v := range vs { |
× |
NEW
|
_, _ = b.Buffer.WriteString(fmt.Sprint(v)) |
× |
NEW
|
} |
× |
30 |
} |
|
31 |
|
|
32 |
// Writeln method
|
|
NEW
|
func (b *Buffer) Writeln(s string) { |
× |
NEW
|
_, _ = b.Buffer.WriteString(s) |
× |
NEW
|
_ = b.Buffer.WriteByte('\n')
|
× |
NEW
|
} |
× |
37 |
|
|
38 |
// ResetAndGet buffer string.
|
|
NEW
|
func (b *Buffer) ResetAndGet() string { |
× |
NEW
|
s := b.String() |
× |
NEW
|
b.Reset() |
× |
NEW
|
return s
|
× |
NEW
|
} |
× |