Пример #1
0
 public void testMatchMarkerAcrossUnreadBuffers() throws IOException {
   final LexerSource src = newSource("in\n=end");
   src.unreadMany("=beg");
   assertTrue(src.matchMarker(new ByteList(safeGetBytes("=begin")), false, false));
 }
Пример #2
0
 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");
 }
Пример #3
0
 public void testMatchMarkerShouldNotCountNewlinesAsWhitespace() throws IOException {
   final LexerSource src = newSource("\n=begin\n=end");
   assertFalse(src.matchMarker(new ByteList(safeGetBytes("=begin")), true, false));
 }
Пример #4
0
 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");
 }
Пример #5
0
 public void testMatchMarkerShouldNotAdvanceIfItDoesntMatch() throws IOException {
   final LexerSource src = newSource("=begin\n=end");
   assertFalse(src.matchMarker(new ByteList(safeGetBytes("=end")), false, false));
   assertReadShouldProduce(src, "=begin");
 }
Пример #6
0
 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");
 }