@@ -40,7 +40,7 @@ func TestNewContext(t *testing.T) {
40
40
assert .Nil (t , ctx .response )
41
41
}
42
42
43
- func TestContextReset (t * testing.T ) {
43
+ func TestContext_reset (t * testing.T ) {
44
44
ctx := newContext (New ())
45
45
46
46
req := httptest .NewRequest (http .MethodGet , "/" , nil )
@@ -55,7 +55,7 @@ func TestContextReset(t *testing.T) {
55
55
assert .Equal (t , make (Params ), ctx .params )
56
56
}
57
57
58
- func TestContextRequest (t * testing.T ) {
58
+ func TestContext_Request (t * testing.T ) {
59
59
ctx := newContext (New ())
60
60
61
61
req := httptest .NewRequest (http .MethodGet , "/" , nil )
@@ -65,7 +65,7 @@ func TestContextRequest(t *testing.T) {
65
65
assert .Equal (t , req , ctx .Request ())
66
66
}
67
67
68
- func TestContextResponse (t * testing.T ) {
68
+ func TestContext_Response (t * testing.T ) {
69
69
ctx := newContext (New ())
70
70
71
71
res := httptest .NewRecorder ()
@@ -76,7 +76,7 @@ func TestContextResponse(t *testing.T) {
76
76
assert .Equal (t , expectedRes , ctx .Response ())
77
77
}
78
78
79
- func TestContextSetParams (t * testing.T ) {
79
+ func TestContext_setParams (t * testing.T ) {
80
80
ctx := newContext (New ())
81
81
82
82
params := Params {"foo" : "bar" , "abc" : "xyz" }
@@ -86,7 +86,7 @@ func TestContextSetParams(t *testing.T) {
86
86
assert .Equal (t , params , ctx .params )
87
87
}
88
88
89
- func TestContextParams (t * testing.T ) {
89
+ func TestContext_Params (t * testing.T ) {
90
90
ctx := newContext (New ())
91
91
92
92
params := Params {"foo" : "bar" , "abc" : "xyz" }
@@ -96,7 +96,7 @@ func TestContextParams(t *testing.T) {
96
96
assert .Equal (t , params , ctx .Params ())
97
97
}
98
98
99
- func TestContextParam (t * testing.T ) {
99
+ func TestContext_Param (t * testing.T ) {
100
100
ctx := newContext (New ())
101
101
102
102
params := Params {"foo" : "bar" , "abc" : "xyz" }
@@ -107,7 +107,7 @@ func TestContextParam(t *testing.T) {
107
107
assert .Equal (t , params ["abc" ], ctx .Param ("abc" ))
108
108
}
109
109
110
- func TestContextQueryParams (t * testing.T ) {
110
+ func TestContext_QueryParams (t * testing.T ) {
111
111
ctx := newContext (New ())
112
112
113
113
req := httptest .NewRequest (http .MethodGet , "/?foo=bar&abc=xyz&abc=2" , nil )
@@ -123,7 +123,7 @@ func TestContextQueryParams(t *testing.T) {
123
123
assert .Equal (t , url.Values {}, ctx .QueryParams ())
124
124
}
125
125
126
- func TestContextQueryParam (t * testing.T ) {
126
+ func TestContext_QueryParam (t * testing.T ) {
127
127
ctx := newContext (New ())
128
128
129
129
req := httptest .NewRequest (http .MethodGet , "/?foo=bar&abc=xyz&abc=2" , nil )
@@ -135,7 +135,7 @@ func TestContextQueryParam(t *testing.T) {
135
135
assert .Equal (t , "" , ctx .QueryParam ("does_not_exist" ))
136
136
}
137
137
138
- func TestContextQueryParamMultiple (t * testing.T ) {
138
+ func TestContext_QueryParamMultiple (t * testing.T ) {
139
139
ctx := newContext (New ())
140
140
141
141
req := httptest .NewRequest (http .MethodGet , "/?foo=bar&abc=xyz&abc=2" , nil )
@@ -147,7 +147,7 @@ func TestContextQueryParamMultiple(t *testing.T) {
147
147
assert .Equal (t , []string {}, ctx .QueryParamMultiple ("does_not_exist" ))
148
148
}
149
149
150
- func TestContextSet (t * testing.T ) {
150
+ func TestContext_Set (t * testing.T ) {
151
151
ctx := newContext (New ())
152
152
ctx .reset (nil , nil )
153
153
@@ -160,7 +160,7 @@ func TestContextSet(t *testing.T) {
160
160
assert .Equal (t , 1 , len (ctx .storage ))
161
161
}
162
162
163
- func TestContextGet (t * testing.T ) {
163
+ func TestContext_Get (t * testing.T ) {
164
164
ctx := newContext (New ())
165
165
ctx .reset (nil , nil )
166
166
@@ -172,7 +172,7 @@ func TestContextGet(t *testing.T) {
172
172
assert .Equal (t , 12.64 , val )
173
173
}
174
174
175
- func TestContextGetSetDataRace (t * testing.T ) {
175
+ func TestContext_GetSet_DataRace (t * testing.T ) {
176
176
ctx := newContext (New ())
177
177
ctx .reset (nil , nil )
178
178
@@ -188,7 +188,7 @@ func TestContextGetSetDataRace(t *testing.T) {
188
188
<- ch
189
189
}
190
190
191
- func TestContextWriteContentType (t * testing.T ) {
191
+ func TestContext_writeContentType (t * testing.T ) {
192
192
ctx := newContext (New ())
193
193
194
194
res := httptest .NewRecorder ()
@@ -207,7 +207,7 @@ func TestContextWriteContentType(t *testing.T) {
207
207
assert .Equal (t , "application/json" , ctx .response .Header ().Get ("Content-Type" ))
208
208
}
209
209
210
- func TestNoContent (t * testing.T ) {
210
+ func Test_NoContent (t * testing.T ) {
211
211
ctx := newContext (New ())
212
212
213
213
res := httptest .NewRecorder ()
@@ -218,7 +218,7 @@ func TestNoContent(t *testing.T) {
218
218
assert .Equal (t , http .StatusNoContent , res .Code )
219
219
}
220
220
221
- func TestContextReadJSON (t * testing.T ) {
221
+ func TestContext_ReadJSON (t * testing.T ) {
222
222
ctx := newContext (New ())
223
223
224
224
req := httptest .NewRequest (http .MethodGet , "/" , strings .NewReader ("{\" name\" :\" Mojix\" ,\" age\" :22}" ))
@@ -245,7 +245,7 @@ func TestContextReadJSON(t *testing.T) {
245
245
assert .Equal (t , http .StatusBadRequest , httpErr .Code )
246
246
}
247
247
248
- func TestContextJSON (t * testing.T ) {
248
+ func TestContext_JSON (t * testing.T ) {
249
249
ctx := newContext (New ())
250
250
251
251
res := httptest .NewRecorder ()
@@ -271,7 +271,7 @@ func TestContextJSON(t *testing.T) {
271
271
assert .Equal (t , http .StatusInternalServerError , httpErr .Code )
272
272
}
273
273
274
- func TestContextJSONIndent (t * testing.T ) {
274
+ func TestContext_JSONIndent (t * testing.T ) {
275
275
ctx := newContext (New ())
276
276
277
277
res := httptest .NewRecorder ()
@@ -297,7 +297,7 @@ func TestContextJSONIndent(t *testing.T) {
297
297
assert .Equal (t , http .StatusInternalServerError , httpErr .Code )
298
298
}
299
299
300
- func TestContextJSONByte (t * testing.T ) {
300
+ func TestContext_JSONByte (t * testing.T ) {
301
301
ctx := newContext (New ())
302
302
303
303
res := httptest .NewRecorder ()
@@ -317,7 +317,7 @@ func TestContextJSONByte(t *testing.T) {
317
317
assert .Equal (t , "{\" name\" :\" foo\" ,\" age\" :1999}" , res .Body .String ())
318
318
}
319
319
320
- func TestContextReadXML (t * testing.T ) {
320
+ func TestContext_ReadXML (t * testing.T ) {
321
321
ctx := newContext (New ())
322
322
323
323
req := httptest .NewRequest (http .MethodGet , "/" , strings .NewReader ("<person><name>Mojix</name><age>22</age></person>" ))
@@ -342,7 +342,7 @@ func TestContextReadXML(t *testing.T) {
342
342
assert .Equal (t , http .StatusBadRequest , httpErr .Code )
343
343
}
344
344
345
- func TestContextXML (t * testing.T ) {
345
+ func TestContext_XML (t * testing.T ) {
346
346
ctx := newContext (New ())
347
347
348
348
res := httptest .NewRecorder ()
@@ -368,7 +368,7 @@ func TestContextXML(t *testing.T) {
368
368
assert .Equal (t , http .StatusInternalServerError , httpErr .Code )
369
369
}
370
370
371
- func TestContextXMLIndent (t * testing.T ) {
371
+ func TestContext_XMLIndent (t * testing.T ) {
372
372
ctx := newContext (New ())
373
373
374
374
res := httptest .NewRecorder ()
@@ -394,7 +394,7 @@ func TestContextXMLIndent(t *testing.T) {
394
394
assert .Equal (t , http .StatusInternalServerError , httpErr .Code )
395
395
}
396
396
397
- func TestContextXMLByte (t * testing.T ) {
397
+ func TestContext_XMLByte (t * testing.T ) {
398
398
ctx := newContext (New ())
399
399
400
400
res := httptest .NewRecorder ()
@@ -414,7 +414,7 @@ func TestContextXMLByte(t *testing.T) {
414
414
assert .Equal (t , "<person><name>foo</name><age>1999</age></person>" , res .Body .String ())
415
415
}
416
416
417
- func TestContextHTML (t * testing.T ) {
417
+ func TestContext_HTML (t * testing.T ) {
418
418
k := New ()
419
419
renderer := htmlrenderer .New ("testdata/templates/" , "layouts/" , ".html" , false )
420
420
renderer .AddFunc ("greet" , func () int { return 1 })
@@ -439,7 +439,7 @@ func TestContextHTML(t *testing.T) {
439
439
assert .Equal (t , "text/html" , res .Header ().Get ("Content-Type" ))
440
440
}
441
441
442
- func TestContextHTMLString (t * testing.T ) {
442
+ func TestContext_HTMLString (t * testing.T ) {
443
443
ctx := newContext (New ())
444
444
445
445
res := httptest .NewRecorder ()
0 commit comments