(t *testing.T)
| 179 | } |
| 180 | |
| 181 | func TestErrCodeString(t *testing.T) { |
| 182 | tests := []struct { |
| 183 | code ErrCode |
| 184 | expected string |
| 185 | }{ |
| 186 | {ErrCodeNo, "NO_ERROR"}, |
| 187 | {ErrCodeProtocol, "PROTOCOL_ERROR"}, |
| 188 | {ErrCodeFlowControl, "FLOW_CONTROL_ERROR"}, |
| 189 | {ErrCodeStreamClosed, "STREAM_CLOSED"}, |
| 190 | } |
| 191 | for _, tt := range tests { |
| 192 | if got := tt.code.String(); got != tt.expected { |
| 193 | t.Errorf("ErrCode(%d).String() = %q, want %q", uint32(tt.code), got, tt.expected) |
| 194 | } |
| 195 | } |
| 196 | } |