| 14 | } |
| 15 | |
| 16 | func TestSettingIDString(t *testing.T) { |
| 17 | tests := []struct { |
| 18 | id SettingID |
| 19 | expected string |
| 20 | }{ |
| 21 | {SettingHeaderTableSize, "HEADER_TABLE_SIZE"}, |
| 22 | {SettingEnablePush, "ENABLE_PUSH"}, |
| 23 | {SettingMaxConcurrentStreams, "MAX_CONCURRENT_STREAMS"}, |
| 24 | {SettingInitialWindowSize, "INITIAL_WINDOW_SIZE"}, |
| 25 | {SettingMaxFrameSize, "MAX_FRAME_SIZE"}, |
| 26 | {SettingMaxHeaderListSize, "MAX_HEADER_LIST_SIZE"}, |
| 27 | {SettingID(0x99), "UNKNOWN_SETTING_153"}, |
| 28 | } |
| 29 | for _, tt := range tests { |
| 30 | if got := tt.id.String(); got != tt.expected { |
| 31 | t.Errorf("SettingID(%d).String() = %q, want %q", uint16(tt.id), got, tt.expected) |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | func TestSettingString(t *testing.T) { |
| 37 | s := Setting{ID: SettingHeaderTableSize, Val: 4096} |