Use more portable pattern counting constructs in test driver. Reviewed-by: sspitsyn, sla, coleenp
Reviewed-by: sspitsyn, alanb
Reviewed-by: coleenp, sspitsyn