blob: e70f3d80372b79858623281ad0124d677df8d162 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package sync
import (
"io"
"strings"
"testing"
)
func TestGetAndPutBufioReader(t *testing.T) {
wanted := "someinput"
r := GetBufioReader(strings.NewReader(wanted))
if r == nil {
t.Error("nil was not expected")
}
got, err := r.ReadString(0)
if err != nil && err != io.EOF {
t.Errorf("unexpected error reading string: %v", err)
}
if wanted != got {
t.Errorf("wanted %q got %q", wanted, got)
}
PutBufioReader(r)
}
|