@@ -239,10 +239,16 @@ func TestEchoURL(t *testing.T) {
239
239
static := func (* Context ) {}
240
240
getUser := func (* Context ) {}
241
241
getFile := func (* Context ) {}
242
+ getGroups := func (* Context ) {}
243
+ getGroup := func (* Context ) {}
244
+
242
245
e .Get ("/static/file" , static )
243
246
e .Get ("/users/:id" , getUser )
244
247
e .Get ("/users/:uid/files/:fid" , getFile )
245
248
249
+ eg := e .Group ("/groups" )
250
+ eg .Get ("/:id" , getGroup )
251
+
246
252
if e .URL (static ) != "/static/file" {
247
253
t .Error ("uri should be /static/file" )
248
254
}
@@ -261,6 +267,18 @@ func TestEchoURL(t *testing.T) {
261
267
if e .URI (getFile , "1" , "1" ) != "/users/1/files/1" {
262
268
t .Error ("uri should be /users/1/files/1" )
263
269
}
270
+ if e .URI (getGroups ) != "/groups" {
271
+ t .Error ("uri should be /groups" )
272
+ }
273
+ if e .URI (getGroup , "1" ) != "/groups/1" {
274
+ t .Error ("uri should be /groups/1" )
275
+ }
276
+ if eg .URI (getGroups ) != "/groups" {
277
+ t .Error ("uri should be /groups" )
278
+ }
279
+ if eg .URI (getGroup , "1" ) != "/groups/1" {
280
+ t .Error ("uri should be /groups/1" )
281
+ }
264
282
}
265
283
266
284
func TestEchoNotFound (t * testing.T ) {
0 commit comments