@ -682,13 +682,9 @@ func TestFindAllMatches(t *testing.T) {
panic ( fmt . Errorf ( "Test Error: %v" , err ) )
}
} else {
matchIndices := FindAllMatches ( regComp , test . str )
zeroGroups := make ( [ ] Group , len ( matchIndices ) )
for i , m := range matchIndices {
zeroGroups [ i ] = m [ 0 ]
}
if ! slices . Equal ( test . result , zeroGroups ) {
t . Errorf ( "Wanted %v Got %v\n" , test . result , zeroGroups )
matchIndices := regComp . FindAll ( test . str )
if ! slices . Equal ( test . result , matchIndices ) {
t . Errorf ( "Wanted %v Got %v\n" , test . result , matchIndices )
}
}
} )
@ -720,6 +716,32 @@ func TestFindString(t *testing.T) {
}
}
func TestFindAllStrings ( t * testing . T ) {
t . Skip ( "Skipping finding all strings" )
for _ , test := range reTests {
t . Run ( test . re + " " + test . str , func ( t * testing . T ) {
regComp , err := Compile ( test . re , test . flags ... )
if err != nil {
if test . result != nil {
panic ( err )
}
} else {
foundStrings := regComp . FindAllString ( test . str )
if len ( test . result ) != len ( foundStrings ) {
t . Errorf ( "Differing number of matches: Wanted %v matches Got %v matches\n" , len ( test . result ) , len ( foundStrings ) )
} else {
for idx , group := range test . result {
groupStr := test . str [ group . StartIdx : group . EndIdx ]
if groupStr != foundStrings [ idx ] {
t . Errorf ( "Wanted %v Got %v\n" , groupStr , foundStrings [ idx ] )
}
}
}
}
} )
}
}
func TestFindAllGroups ( t * testing . T ) {
for _ , test := range groupTests {
t . Run ( test . re + " " + test . str , func ( t * testing . T ) {
@ -729,7 +751,7 @@ func TestFindAllGroups(t *testing.T) {
panic ( err )
}
}
matchIndices := FindAllMatches ( regComp , test . str )
matchIndices := regComp . FindAllSubmatch ( test . str )
for i := range matchIndices {
for j := range matchIndices [ i ] {
if matchIndices [ i ] [ j ] . isValid ( ) {