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
5package http2
6
7import "testing"
8
9func TestErrCodeString(t *testing.T) {
10	tests := []struct {
11		err  ErrCode
12		want string
13	}{
14		{ErrCodeProtocol, "PROTOCOL_ERROR"},
15		{0xd, "HTTP_1_1_REQUIRED"},
16		{0xf, "unknown error code 0xf"},
17	}
18	for i, tt := range tests {
19		got := tt.err.String()
20		if got != tt.want {
21			t.Errorf("%d. Error = %q; want %q", i, got, tt.want)
22		}
23	}
24}
25