public bool IsMatch(EscapedString str, int startPosition = 0) { if ((str.Length - startPosition) < Lexem.Length) { return(false); } if (!IsMatch(str, startPosition + Lexem.Length, nextCharTemplate)) { return(false); } if (!IsMatch(str, startPosition - 1, prevCharTemplate)) { return(false); } return(str.SubstringOrdinalEqual(Lexem, startPosition)); }
public void NotOrdinalEqual_WhenSourceIs(string src, int compareStart, string other) { var parsed = new EscapedString(src, '\\'); parsed.SubstringOrdinalEqual(other, compareStart).Should().BeFalse(); }