File: pipe_test.go

package info (click to toggle)
golang-github-bradfitz-http2 0.0~git20150509-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 740 kB
  • ctags: 760
  • sloc: xml: 4,781; makefile: 22
file content (24 lines) | stat: -rw-r--r-- 470 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
// Copyright 2014 The Go Authors.
// See https://code.google.com/p/go/source/browse/CONTRIBUTORS
// Licensed under the same terms as Go itself:
// https://code.google.com/p/go/source/browse/LICENSE

package http2

import (
	"errors"
	"testing"
)

func TestPipeClose(t *testing.T) {
	var p pipe
	p.c.L = &p.m
	a := errors.New("a")
	b := errors.New("b")
	p.Close(a)
	p.Close(b)
	_, err := p.Read(make([]byte, 1))
	if err != a {
		t.Errorf("err = %v want %v", err, a)
	}
}