private static void CheckMatchError( StringMatcher m, Func<bool> fail )
{
int idx = m.StartIndex;
int len = m.Length;
Assert.That( fail(), Is.False );
Assert.That( m.IsError );
Assert.That( m.ErrorMessage, Is.Not.Null.Or.Empty );
Assert.That( m.StartIndex == idx, "Head must not move on error." );
Assert.That( m.Length == len, "Length must not change on error." );
m.SetSuccess();
}
}