public void TestPeekCharOffset(string text, char expected1, char expected2) { ZeroCopyReader reader = new ZeroCopyReader(text); Assert.That(expected1.EqualsSpans(reader.PeekCharSpan())); Assert.That(expected2.EqualsSpans(reader.PeekCharSpan(1))); }
public void TestPeekChar(string text, char expected) { ZeroCopyReader reader = new ZeroCopyReader(text); Assert.That(expected.EqualsSpans(reader.PeekCharSpan())); Assert.That(expected.EqualsSpans(reader.PeekCharSpan())); Assert.That(expected.EqualsSpans(reader.PeekCharSpan())); }
public void TestExpectChar(string text, char expectedChr, bool expected, char?peek) { ZeroCopyReader reader = new ZeroCopyReader(text); Assert.AreEqual(expected, reader.ReadCharIf(expectedChr)); Assert.True(peek.EqualsSpans(reader.PeekCharSpan())); }
private void SkipComment() { while (_reader.IsNotEof) { while (_reader.IsNotEof && !_reader.SkipEol()) { _reader.Position += 1; } if (_reader.PeekCharSpan().IsEqual('#')) { _reader.Position += 1; } else { return; } } }