private static void CheckMatchError(StringMatcher m, Func <bool> fail)
        {
            int idx = m.StartIndex;
            int len = m.Length;

            fail().Should().BeFalse();
            m.IsError.Should().BeTrue();
            m.ErrorMessage.Should().NotBeNullOrEmpty();
            m.StartIndex.Should().Be(idx, "Head must not move on error.");
            m.Length.Should().Be(len, "Length must not change on error.");
            m.ClearError();
        }