// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "bytes" "errors" "testing" ) func TestPipeClose(t *testing.T) { var p pipe p.b = new(bytes.Buffer) a := errors.New("a") b := errors.New("b") p.CloseWithError(a) p.CloseWithError(b) _, err := p.Read(make([]byte, 1)) if err != a { t.Errorf("err = %v want %v", err, a) } }