Add test case for indexOf using an invalid QRegularExpression

Change-Id: I3677d0ecd406388a8f1eb65ec013595904da4c2d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>