Issue #1655
(t *testing.T)
| 758 | |
| 759 | // Issue #1655 |
| 760 | func TestContext_SetParamNamesShouldNotModifyPathValuesCapacity(t *testing.T) { |
| 761 | e := New() |
| 762 | c := e.NewContext(nil, nil) |
| 763 | |
| 764 | assert.Equal(t, int32(0), e.contextPathParamAllocSize.Load()) |
| 765 | expectedTwoParams := PathValues{ |
| 766 | {Name: "1", Value: "one"}, |
| 767 | {Name: "2", Value: "two"}, |
| 768 | } |
| 769 | c.SetPathValues(expectedTwoParams) |
| 770 | assert.Equal(t, int32(0), e.contextPathParamAllocSize.Load()) |
| 771 | assert.Equal(t, expectedTwoParams, c.PathValues()) |
| 772 | |
| 773 | expectedThreeParams := PathValues{ |
| 774 | {Name: "1", Value: "one"}, |
| 775 | {Name: "2", Value: "two"}, |
| 776 | {Name: "3", Value: "three"}, |
| 777 | } |
| 778 | c.SetPathValues(expectedThreeParams) |
| 779 | assert.Equal(t, int32(0), e.contextPathParamAllocSize.Load()) |
| 780 | assert.Equal(t, expectedThreeParams, c.PathValues()) |
| 781 | } |
| 782 | |
| 783 | func TestContextFormValue(t *testing.T) { |
| 784 | f := make(url.Values) |
nothing calls this directly
no test coverage detected
searching dependent graphs…