Exemplo n.º 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));
 }
Exemplo n.º 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");
 }
Exemplo n.º 3
0
 public void testMatchMarkerShouldNotCountNewlinesAsWhitespace() throws IOException {
   final LexerSource src = newSource("\n=begin\n=end");
   assertFalse(src.matchMarker(new ByteList(safeGetBytes("=begin")), true, false));
 }
Exemplo n.º 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");
 }
Exemplo n.º 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");
 }
Exemplo n.º 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");
 }