text stringlengths 171 29.4k |
|---|
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
static Document parseByteData(ByteBuffer byteData, String charsetName, String baseUri, Parser parser) {
String docData;
Document doc = null;
if (chars... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
CombiningEvaluator(Collection<Evaluator> evaluators) {
this();
this.evaluators.addAll(evaluators);
}
// Test Case
[/INST]
@Test public void handlesCo... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
Evaluator parse() {
tq.consumeWhitespace();
if (tq.matchesAny(combinators)) { // if starts with a combinator, use root as elements
evals.add(new ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private void combinator(char combinator) {
tq.consumeWhitespace();
String subQuery = consumeSubQuery(); // support multi > childs
Evaluator e;
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void elementIsNotASiblingOfItself() {
Document doc = Jsoup.parse("<div><p>One<p>Two<p>Three</div>");
Element p2 = doc.sel... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Elements siblingElements() {
return parent().children();
}
// Test Case
[/INST]
@Test public void elementIsNotASiblingOfItself() {
Document d... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public List<Node> siblingNodes() {
return parent().childNodes();
}
// Test Case
[/INST]
@Test public void elementIsNotASiblingOfItself() {
Document ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Element nextElementSibling() {
List<Element> siblings = parent().children();
Integer index = indexInList(this, siblings);
Validate.notNull(inde... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Element previousElementSibling() {
List<Element> siblings = parent().children();
Integer index = indexInList(this, siblings);
Validate.notNull(... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Node previousSibling() {
List<Node> siblings = parentNode.childNodes;
Integer index = siblingIndex();
Validate.notNull(index);
if (ind... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
Character consumeCharacterReference(Character additionalAllowedCharacter, boolean inAttribute) {
if (reader.isEmpty())
return null;
if (additional... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
void read(Tokeniser t, CharacterReader r) {
if (r.matchesLetter()) {
String name = r.consumeLetterSequence();
t.tagPending.app... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Document clean(Document dirtyDocument) {
Validate.notNull(dirtyDocument);
Document clean = Document.createShell(dirtyDocument.baseUri());
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
static String getCharsetFromContentType(String contentType) {
if (contentType == null) return null;
Matcher m = charsetPattern.matcher(contentType);
i... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
static String unescape(String string, boolean strict) {
if (!string.contains("&"))
return string;
Matcher m = strict? strictUnescapePattern.matche... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public String title() {
// title is a preserve whitespace tag (for document output), but normalised here
Element titleEl = getElementsByTag("title").first();
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private Element addChildToParent(Element child, boolean isEmptyElement) {
Element parent = popStackToSuitableContainer(child.tag());
Tag childTag = child.tag(... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private boolean stackHasValidParent(Tag childTag) {
if (stack.size() == 1 && childTag.equals(htmlTag))
return true; // root is valid for html node
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Element append(String html) {
Validate.notNull(html);
Element fragment = Parser.parseBodyFragment(html, baseUri).body();
for (Node nod... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Element prepend(String html) {
Validate.notNull(html);
Element fragment = Parser.parseBodyFragment(html, baseUri).body();
List<Node> n... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Element wrap(String html) {
Validate.notEmpty(html);
Element wrapBody = Parser.parseBodyFragment(html, baseUri).body();
Elements wrapChildren ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void testAppendRowToTable() {
Document doc = Jsoup.parse("<table><tr><td>1</td></tr></table>");
Element table = doc.selec... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void testAppendRowToTable() {
Document doc = Jsoup.parse("<table><tr><td>1</td></tr></table>");
Element table = doc.selec... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void testAppendRowToTable() {
Document doc = Jsoup.parse("<table><tr><td>1</td></tr></table>");
Element table = doc.selec... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void testAppendRowToTable() {
Document doc = Jsoup.parse("<table><tr><td>1</td></tr></table>");
Element table = doc.selec... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void testAppendRowToTable() {
Document doc = Jsoup.parse("<table><tr><td>1</td></tr></table>");
Element table = doc.selec... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void testAppendRowToTable() {
Document doc = Jsoup.parse("<table><tr><td>1</td></tr></table>");
Element table = doc.selec... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void testAppendRowToTable() {
Document doc = Jsoup.parse("<table><tr><td>1</td></tr></table>");
Element table = doc.selec... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void testAppendRowToTable() {
Document doc = Jsoup.parse("<table><tr><td>1</td></tr></table>");
Element table = doc.selec... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
void insert(Token.Comment commentToken) {
Comment comment = new Comment(commentToken.getData(), baseUri);
Node insert = comment;
insertNode(insert);
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
void read(Tokeniser t, CharacterReader r) {
// todo: handle bogus comment starting from eof. when does that trigger?
// rewind to capture characte... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Element clone() {
Element clone = (Element) super.clone();
clone.classNames();
return clone;
}
// Test Case
[/INST]
@Test public void ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
Element insert(Token.StartTag startTag) {
// handle empty unknown tags
// when the spec expects an empty tag, will directly hit insertEmpty, so won't generate... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
int nextIndexOf(CharSequence seq) {
// doesn't handle scanning for surrogates
char startChar = seq.charAt(0);
for (int offset = pos; offset < length; ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
boolean process(Token t, HtmlTreeBuilder tb) {
switch (t.type) {
case Character: {
Token.Character c = t.asCharacter();
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test
public void shouldCorrectCharsetForDuplicateCharsetString() {
assertEquals("iso-8859-1", DataUtil.getCharsetFromContentType("text/ht... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test
public void shouldCorrectCharsetForDuplicateCharsetString() {
assertEquals("iso-8859-1", DataUtil.getCharsetFromContentType("text/ht... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test
public void shouldCorrectCharsetForDuplicateCharsetString() {
assertEquals("iso-8859-1", DataUtil.getCharsetFromContentType("text/ht... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test
public void shouldCorrectCharsetForDuplicateCharsetString() {
assertEquals("iso-8859-1", DataUtil.getCharsetFromContentType("text/ht... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public String html() {
StringBuilder accum = new StringBuilder();
html(accum);
return accum.toString().trim();
}
// Test Case
[/INST]
@Test p... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
boolean process(Token t, HtmlTreeBuilder tb) {
switch (t.type) {
case Character: {
Token.Character c = t.asCharacter();
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
static Document parseByteData(ByteBuffer byteData, String charsetName, String baseUri, Parser parser) {
String docData;
Document doc = null;
if (chars... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public DocumentType(String name, String publicId, String systemId, String baseUri) {
super(baseUri);
Validate.notEmpty(name);
attr("name", name);
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public List<Connection.KeyVal> formData() {
ArrayList<Connection.KeyVal> data = new ArrayList<Connection.KeyVal>();
// iterate the form control elements and ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private static <E extends Element> Integer indexInList(Element search, List<E> elements) {
Validate.notNull(search);
Validate.notNull(elements);
for ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected boolean processStartTag(String name) {
return process(start.reset().name(name));
}
// Test Case
[/INST]
@Test
public void testInvalidTableConte... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public boolean processStartTag(String name, Attributes attrs) {
start.reset();
start.nameAttr(name, attrs);
return process(start);
}
// Test Case... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected boolean processEndTag(String name) {
return process(end.reset().name(name));
}
// Test Case
[/INST]
@Test
public void testInvalidTableContents(... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
void resetInsertionMode() {
boolean last = false;
for (int pos = stack.size() -1; pos >= 0; pos--) {
Element node = stack.get(pos);
if... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
static void escape(StringBuilder accum, String string, Document.OutputSettings out,
boolean inAttribute, boolean normaliseWhite, boolean stripLeadingWh... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
static void escape(StringBuilder accum, String string, Document.OutputSettings out,
boolean inAttribute, boolean normaliseWhite, boolean stripLeadingWh... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
void processResponseHeaders(Map<String, List<String>> resHeaders) {
for (Map.Entry<String, List<String>> entry : resHeaders.entrySet()) {
Stri... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected void addChildren(int index, Node... children) {
Validate.noNullElements(children);
ensureChildNodes();
for (int i = children.length - 1; i >... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private Attribute parseAttribute() {
tq.consumeWhitespace();
String key = tq.consumeAttributeKey();
String value = "";
tq.consumeWhitespace();... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
static Document parseByteData(ByteBuffer byteData, String charsetName, String baseUri, Parser parser) {
String docData;
Document doc = null;
// look ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
boolean matchesLetter() {
if (isEmpty())
return false;
char c = input[pos];
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
}... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public String getWholeDeclaration() {
final String decl = this.name;
if(decl.equals("xml") && attributes.size() > 1 ) {
StringBuilder sb = new Str... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
void outerHtmlHead(Appendable accum, int depth, Document.OutputSettings out) throws IOException {
accum
.append("<")
.append(isProcessingInstruct... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test
public void testMetaCharsetUpdateXmlNoCharset() {
final Document doc = createXmlDocument("1.0", "none", false);
doc.updateMe... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test
public void testMetaCharsetUpdateXmlNoCharset() {
final Document doc = createXmlDocument("1.0", "none", false);
doc.updateMe... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public String chompBalanced(char open, char close) {
int start = -1;
int end = -1;
int depth = 0;
char last = 0;
do {
if ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private void copyAttributes(org.jsoup.nodes.Node source, Element el) {
for (Attribute attribute : source.attributes()) {
// valid xml attribut... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '>':
t.tagPending.selfClos... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
void insert(Token.Doctype d) {
DocumentType doctypeNode = new DocumentType(settings.normalizeTag(d.getName()), d.getPublicIdentifier(), d.getSystemIdentifier(), baseU... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void testRoundTrip() {
String base = "<!DOCTYPE html>";
assertEquals("<!doctype html>", htmlOutput(base));
assert... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void testRoundTrip() {
String base = "<!DOCTYPE html>";
assertEquals("<!doctype html>", htmlOutput(base));
assert... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test public void testRoundTrip() {
String base = "<!DOCTYPE html>";
assertEquals("<!doctype html>", htmlOutput(base));
assert... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public void removeIgnoreCase(String key) {
Validate.notEmpty(key);
if (attributes == null)
return;
for (Iterator<String> it = attributes.k... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public boolean isValid(Document dirtyDocument) {
Validate.notNull(dirtyDocument);
Document clean = Document.createShell(dirtyDocument.baseUri());
int... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public static List<Node> parseFragment(String fragmentHtml, Element context, String baseUri) {
HtmlTreeBuilder treeBuilder = new HtmlTreeBuilder();
return tre... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public static boolean isValid(String bodyHtml, Whitelist whitelist) {
return new Cleaner(whitelist).isValid(parseBodyFragment(bodyHtml, ""));
}
// Test Case
[/IN... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
final void newAttribute() {
if (attributes == null)
attributes = new Attributes();
if (pendingAttributeName != null) {
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
static String unescape(String string) {
if (!string.contains("&"))
return string;
Matcher m = unescapePattern.matcher(string); // &(#(x|X)?([0-9a... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public static Evaluator parse(String query) {
QueryParser p = new QueryParser(query);
return p.parse();
}
// Test Case
[/INST]
@Test(expected... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public String chompBalanced(char open, char close) {
int start = -1;
int end = -1;
int depth = 0;
char last = 0;
boolean inQuote = fal... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public boolean hasClass(String className) {
final String classAttr = attributes.get("class");
final int len = classAttr.length();
final int wantLen = ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
boolean anyOtherEndTag(Token t, HtmlTreeBuilder tb) {
String name = t.asEndTag().normalName();
ArrayList<Element> stack = tb.getStack();
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
Token read() {
if (!selfClosingFlagAcknowledged) {
error("Self closing flag not acknowledged");
selfClosingFlagAcknowledged = true;
}
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
Element insertEmpty(Token.StartTag startTag) {
Tag tag = Tag.valueOf(startTag.name(), settings);
Element el = new Element(tag, baseUri, startTag.attributes);
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private static void handleRawtext(Token.StartTag startTag, HtmlTreeBuilder tb) {
tb.insert(startTag);
tb.tokeniser.transition(TokeniserState.Rawtext);
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
void clearStackToTableBodyContext() {
clearStackToContext("tbody", "tfoot", "thead");
}
// Test Case
[/INST]
@Test public void testTemplateInsideTable() throws... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
void clearStackToTableRowContext() {
clearStackToContext("tr");
}
// Test Case
[/INST]
@Test public void testTemplateInsideTable() throws IOException {
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
boolean process(Token t, HtmlTreeBuilder tb) {
switch (t.type) {
case StartTag:
Token.StartTag startTag = t.asStartTag();
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isStartTag()) {
Token.StartTag startTag = t.asStartTag();
String name = startTag.... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected List<Node> ensureChildNodes() {
if (childNodes == EMPTY_NODES) {
childNodes = new NodeList(4);
}
return childNodes;
}
// Te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.