File: bufio_test.go

package info (click to toggle)
golang-github-go-git-go-git 5.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,648 kB
  • sloc: makefile: 81; sh: 76
file content (26 lines) | stat: -rw-r--r-- 435 bytes parent folder | download
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)
}