@@ -606,6 +606,37 @@ func TestRouterParamNames(t *testing.T) {
606606 assert .Equal (t , "1" , c .P (1 ))
607607}
608608
609+ func TestRouterStaticDynamicConflict (t * testing.T ) {
610+ e := New ()
611+ r := e .router
612+ c := NewContext (nil , nil , e )
613+
614+ r .Add (GET , "/dictionary/skills" , func (c * Context ) error {
615+ c .Set ("a" , 1 )
616+ return nil
617+ }, e )
618+ r .Add (GET , "/dictionary/:name" , func (c * Context ) error {
619+ c .Set ("b" , 2 )
620+ return nil
621+ }, e )
622+ r .Add (GET , "/server" , func (c * Context ) error {
623+ c .Set ("c" , 3 )
624+ return nil
625+ }, e )
626+
627+ h , _ := r .Find (GET , "/dictionary/skills" , c )
628+ h (c )
629+ assert .Equal (t , 1 , c .Get ("a" ))
630+ c = NewContext (nil , nil , e )
631+ h , _ = r .Find (GET , "/dictionary/type" , c )
632+ h (c )
633+ assert .Equal (t , 2 , c .Get ("b" ))
634+ c = NewContext (nil , nil , e )
635+ h , _ = r .Find (GET , "/server" , c )
636+ h (c )
637+ assert .Equal (t , 3 , c .Get ("c" ))
638+ }
639+
609640func TestRouterAPI (t * testing.T ) {
610641 e := New ()
611642 r := e .router
0 commit comments