@@ -491,16 +491,14 @@ func TestEchoURL(t *testing.T) {
491491 g := e .Group ("/group" )
492492 g .GET ("/users/:uid/files/:fid" , getFile )
493493
494- assertion := assert .New (t )
495-
496- assertion .Equal ("/static/file" , e .URL (static ))
497- assertion .Equal ("/users/:id" , e .URL (getUser ))
498- assertion .Equal ("/users/1" , e .URL (getUser , "1" ))
499- assertion .Equal ("/users/1" , e .URL (getUser , "1" ))
500- assertion .Equal ("/documents/foo.txt" , e .URL (getAny , "foo.txt" ))
501- assertion .Equal ("/documents/*" , e .URL (getAny ))
502- assertion .Equal ("/group/users/1/files/:fid" , e .URL (getFile , "1" ))
503- assertion .Equal ("/group/users/1/files/1" , e .URL (getFile , "1" , "1" ))
494+ assert .Equal (t , "/static/file" , e .URL (static ))
495+ assert .Equal (t , "/users/:id" , e .URL (getUser ))
496+ assert .Equal (t , "/users/1" , e .URL (getUser , "1" ))
497+ assert .Equal (t , "/users/1" , e .URL (getUser , "1" ))
498+ assert .Equal (t , "/documents/foo.txt" , e .URL (getAny , "foo.txt" ))
499+ assert .Equal (t , "/documents/*" , e .URL (getAny ))
500+ assert .Equal (t , "/group/users/1/files/:fid" , e .URL (getFile , "1" ))
501+ assert .Equal (t , "/group/users/1/files/1" , e .URL (getFile , "1" , "1" ))
504502}
505503
506504func TestEchoRoutes (t * testing.T ) {
@@ -607,8 +605,6 @@ func TestEchoServeHTTPPathEncoding(t *testing.T) {
607605}
608606
609607func TestEchoHost (t * testing.T ) {
610- assertion := assert .New (t )
611-
612608 okHandler := func (c Context ) error { return c .String (http .StatusOK , http .StatusText (http .StatusOK )) }
613609 teapotHandler := func (c Context ) error { return c .String (http .StatusTeapot , http .StatusText (http .StatusTeapot )) }
614610 acceptHandler := func (c Context ) error { return c .String (http .StatusAccepted , http .StatusText (http .StatusAccepted )) }
@@ -703,8 +699,8 @@ func TestEchoHost(t *testing.T) {
703699
704700 e .ServeHTTP (rec , req )
705701
706- assertion .Equal (tc .expectStatus , rec .Code )
707- assertion .Equal (tc .expectBody , rec .Body .String ())
702+ assert .Equal (t , tc .expectStatus , rec .Code )
703+ assert .Equal (t , tc .expectBody , rec .Body .String ())
708704 })
709705 }
710706}
@@ -1429,8 +1425,6 @@ func TestEchoListenerNetworkInvalid(t *testing.T) {
14291425}
14301426
14311427func TestEchoReverse (t * testing.T ) {
1432- assert := assert .New (t )
1433-
14341428 e := New ()
14351429 dummyHandler := func (Context ) error { return nil }
14361430
@@ -1440,33 +1434,31 @@ func TestEchoReverse(t *testing.T) {
14401434 e .GET ("/params/:foo/bar/:qux" , dummyHandler ).Name = "/params/:foo/bar/:qux"
14411435 e .GET ("/params/:foo/bar/:qux/*" , dummyHandler ).Name = "/params/:foo/bar/:qux/*"
14421436
1443- assert .Equal ("/static" , e .Reverse ("/static" ))
1444- assert .Equal ("/static" , e .Reverse ("/static" , "missing param" ))
1445- assert .Equal ("/static/*" , e .Reverse ("/static/*" ))
1446- assert .Equal ("/static/foo.txt" , e .Reverse ("/static/*" , "foo.txt" ))
1447-
1448- assert .Equal ("/params/:foo" , e .Reverse ("/params/:foo" ))
1449- assert .Equal ("/params/one" , e .Reverse ("/params/:foo" , "one" ))
1450- assert .Equal ("/params/:foo/bar/:qux" , e .Reverse ("/params/:foo/bar/:qux" ))
1451- assert .Equal ("/params/one/bar/:qux" , e .Reverse ("/params/:foo/bar/:qux" , "one" ))
1452- assert .Equal ("/params/one/bar/two" , e .Reverse ("/params/:foo/bar/:qux" , "one" , "two" ))
1453- assert .Equal ("/params/one/bar/two/three" , e .Reverse ("/params/:foo/bar/:qux/*" , "one" , "two" , "three" ))
1437+ assert .Equal (t , "/static" , e .Reverse ("/static" ))
1438+ assert .Equal (t , "/static" , e .Reverse ("/static" , "missing param" ))
1439+ assert .Equal (t , "/static/*" , e .Reverse ("/static/*" ))
1440+ assert .Equal (t , "/static/foo.txt" , e .Reverse ("/static/*" , "foo.txt" ))
1441+
1442+ assert .Equal (t , "/params/:foo" , e .Reverse ("/params/:foo" ))
1443+ assert .Equal (t , "/params/one" , e .Reverse ("/params/:foo" , "one" ))
1444+ assert .Equal (t , "/params/:foo/bar/:qux" , e .Reverse ("/params/:foo/bar/:qux" ))
1445+ assert .Equal (t , "/params/one/bar/:qux" , e .Reverse ("/params/:foo/bar/:qux" , "one" ))
1446+ assert .Equal (t , "/params/one/bar/two" , e .Reverse ("/params/:foo/bar/:qux" , "one" , "two" ))
1447+ assert .Equal (t , "/params/one/bar/two/three" , e .Reverse ("/params/:foo/bar/:qux/*" , "one" , "two" , "three" ))
14541448}
14551449
14561450func TestEchoReverseHandleHostProperly (t * testing.T ) {
1457- assert := assert .New (t )
1458-
14591451 dummyHandler := func (Context ) error { return nil }
14601452
14611453 e := New ()
14621454 h := e .Host ("the_host" )
14631455 h .GET ("/static" , dummyHandler ).Name = "/static"
14641456 h .GET ("/static/*" , dummyHandler ).Name = "/static/*"
14651457
1466- assert .Equal ("/static" , e .Reverse ("/static" ))
1467- assert .Equal ("/static" , e .Reverse ("/static" , "missing param" ))
1468- assert .Equal ("/static/*" , e .Reverse ("/static/*" ))
1469- assert .Equal ("/static/foo.txt" , e .Reverse ("/static/*" , "foo.txt" ))
1458+ assert .Equal (t , "/static" , e .Reverse ("/static" ))
1459+ assert .Equal (t , "/static" , e .Reverse ("/static" , "missing param" ))
1460+ assert .Equal (t , "/static/*" , e .Reverse ("/static/*" ))
1461+ assert .Equal (t , "/static/foo.txt" , e .Reverse ("/static/*" , "foo.txt" ))
14701462}
14711463
14721464func TestEcho_ListenerAddr (t * testing.T ) {
0 commit comments