Skip to content

Commit

Permalink
add failing test to reveal fault in CharacterReader
Browse files Browse the repository at this point in the history
  • Loading branch information
Simeng-H committed Nov 9, 2023
1 parent 7d46675 commit 379dae2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/java/org/jsoup/parser/CharacterReaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -515,4 +515,20 @@ public void notEmptyAtBufferSplitPoint() {
assertEquals(14, reader.columnNumber());
}

@Test public void consumeAttributeQuotedCanConsumeToSingleQuote() {
String html = "<p title=\"He'llo\" >";
CharacterReader r = new CharacterReader(html);
r.consumeAttributeQuoted(false);
r.advance();
assertEquals("He'llo", r.consumeAttributeQuoted(false));
}

@Test public void consumeAttributeQuotedCanConsumeToDoubleQuote() {
String html = "<p title='He\"llo' >";
CharacterReader r = new CharacterReader(html);
r.consumeAttributeQuoted(true);
r.advance();
assertEquals("He\"llo", r.consumeAttributeQuoted(true));
}

}

0 comments on commit 379dae2

Please sign in to comment.