(t *testing.T)
| 1518 | } |
| 1519 | |
| 1520 | func Test_UnescapeHeaderValue(t *testing.T) { |
| 1521 | t.Parallel() |
| 1522 | cases := []struct { |
| 1523 | in string |
| 1524 | out []byte |
| 1525 | ok bool |
| 1526 | }{ |
| 1527 | {in: "abc", out: []byte("abc"), ok: true}, |
| 1528 | {in: "a\\\"b", out: []byte("a\"b"), ok: true}, |
| 1529 | {in: "c\\\\d", out: []byte("c\\d"), ok: true}, |
| 1530 | {in: "bad\\", ok: false}, |
| 1531 | } |
| 1532 | for _, tc := range cases { |
| 1533 | out, err := unescapeHeaderValue([]byte(tc.in)) |
| 1534 | if tc.ok { |
| 1535 | require.NoError(t, err, tc.in) |
| 1536 | require.Equal(t, tc.out, out, tc.in) |
| 1537 | } else { |
| 1538 | require.Error(t, err, tc.in) |
| 1539 | } |
| 1540 | } |
| 1541 | } |
| 1542 | |
| 1543 | func Test_JoinHeaderValues(t *testing.T) { |
| 1544 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…