public void testMatchMarkerAcrossUnreadBuffers() throws IOException { final LexerSource src = newSource("in\n=end"); src.unreadMany("=beg"); assertTrue(src.matchMarker(new ByteList(safeGetBytes("=begin")), false, false)); }
public void testMatchMarkerShouldVerifyEndOfLineCRLFWithIndent() throws IOException { final LexerSource src = newSource(" =begin\r\n=end\r\n"); assertTrue(src.matchMarker(new ByteList(safeGetBytes("=begin")), true, true)); assertReadShouldProduce(src, "=end"); }
public void testMatchMarkerShouldNotCountNewlinesAsWhitespace() throws IOException { final LexerSource src = newSource("\n=begin\n=end"); assertFalse(src.matchMarker(new ByteList(safeGetBytes("=begin")), true, false)); }
public void testMatchMarkerShouldSkipOverLeadingWhitespace() throws IOException { final LexerSource src = newSource(" =begin\n=end"); assertTrue(src.matchMarker(new ByteList(safeGetBytes("=begin")), true, false)); assertReadShouldProduce(src, "\n=end"); }
public void testMatchMarkerShouldNotAdvanceIfItDoesntMatch() throws IOException { final LexerSource src = newSource("=begin\n=end"); assertFalse(src.matchMarker(new ByteList(safeGetBytes("=end")), false, false)); assertReadShouldProduce(src, "=begin"); }
public void testMatchMarkerShouldMatchAStringInTheInputAndAdvance() throws IOException { final LexerSource src = newSource("=begin\n=end"); assertTrue(src.matchMarker(new ByteList(safeGetBytes("=begin")), false, false)); assertReadShouldProduce(src, "\n=end"); }