(t *testing.T)
| 154 | } |
| 155 | |
| 156 | func TestFramerWriteReadGoAway(t *testing.T) { |
| 157 | var buf bytes.Buffer |
| 158 | fw := NewFramer(&buf, nil) |
| 159 | fw.WriteGoAway(0, ErrCodeNo, []byte("shutdown")) |
| 160 | |
| 161 | fr := NewFramer(nil, &buf) |
| 162 | f, err := fr.ReadFrame() |
| 163 | if err != nil { |
| 164 | t.Fatalf("ReadFrame failed: %v", err) |
| 165 | } |
| 166 | gf, ok := f.(*GoAwayFrame) |
| 167 | if !ok { |
| 168 | t.Fatalf("expected *GoAwayFrame, got %T", f) |
| 169 | } |
| 170 | if gf.LastStreamID != 0 { |
| 171 | t.Fatalf("LastStreamID = %d, want 0", gf.LastStreamID) |
| 172 | } |
| 173 | if gf.ErrCode != ErrCodeNo { |
| 174 | t.Fatalf("ErrCode = %d, want %d", gf.ErrCode, ErrCodeNo) |
| 175 | } |
| 176 | if string(gf.DebugData()) != "shutdown" { |
| 177 | t.Fatalf("DebugData = %q, want 'shutdown'", string(gf.DebugData())) |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | func TestErrCodeString(t *testing.T) { |
| 182 | tests := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…