Use resultSet array length for total match count

This fixes #8726.
This wouldn't actually have caught #8726.  How about doing this instead?

* Change `expectMatchIndex()` to take the expected count as a second argument
* Move this check into there
* Add a check that verifies the actual string found in the search bar, too