File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -555,19 +555,23 @@ func TestString_MatchOne(t *testing.T) {
555555
556556 value := NewString (reporter , "http://example.com/users/john" )
557557
558- m1 := value .Match (`http://(?P<host>.+)/users/(?P<user>.+)` )
559- m1 .chain .assertNotFailed (t )
558+ t .Run ("named" , func (t * testing.T ) {
559+ m := value .Match (`http://(?P<host>.+)/users/(?P<user>.+)` )
560+ m .chain .assertNotFailed (t )
560561
561- assert .Equal (t ,
562- []string {"http://example.com/users/john" , "example.com" , "john" },
563- m1 .submatches )
562+ assert .Equal (t ,
563+ []string {"http://example.com/users/john" , "example.com" , "john" },
564+ m .submatches )
565+ })
564566
565- m2 := value .Match (`http://(.+)/users/(.+)` )
566- m2 .chain .assertNotFailed (t )
567+ t .Run ("unnamed" , func (t * testing.T ) {
568+ m := value .Match (`http://(.+)/users/(.+)` )
569+ m .chain .assertNotFailed (t )
567570
568- assert .Equal (t ,
569- []string {"http://example.com/users/john" , "example.com" , "john" },
570- m2 .submatches )
571+ assert .Equal (t ,
572+ []string {"http://example.com/users/john" , "example.com" , "john" },
573+ m .submatches )
574+ })
571575}
572576
573577func TestString_MatchAll (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments