pipe_test.go 431 B

1234567891011121314151617181920212223
  1. // Copyright 2014 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package http2
  5. import (
  6. "errors"
  7. "testing"
  8. )
  9. func TestPipeClose(t *testing.T) {
  10. var p pipe
  11. p.c.L = &p.m
  12. a := errors.New("a")
  13. b := errors.New("b")
  14. p.Close(a)
  15. p.Close(b)
  16. _, err := p.Read(make([]byte, 1))
  17. if err != a {
  18. t.Errorf("err = %v want %v", err, a)
  19. }
  20. }