Skip to content

Commit

Permalink
#164 PI with a comma
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Nov 7, 2023
1 parent 5a69af3 commit 001bfee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/antlr4/org/xembly/Xembly.g4
Expand Up @@ -131,7 +131,7 @@ directive returns [Directive ret]
$ret = new UpDirective();
}
|
'PI' target=argument data=argument
'PI' target=argument COMMA data=argument
{
try {
$ret = new PiDirective($target.ret.toString(), $data.ret.toString());
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/org/xembly/PiDirectiveTest.java
Expand Up @@ -50,8 +50,8 @@ void addsProcessingInstructionsToDom() throws Exception {
final Iterable<Directive> dirs = new Directives(
StringUtils.join(
new String[] {
"XPATH '/root'; PI 'ab' 'boom \u20ac';",
"ADD 'test'; PI 'foo' 'some data \u20ac';",
"XPATH '/root'; PI 'ab', 'boom \u20ac';",
"ADD 'test'; PI 'foo', 'some data \u20ac';",
}
)
);
Expand Down Expand Up @@ -87,7 +87,7 @@ void addsProcessingInstructionsDirectlyToDom() throws Exception {
@Test
void addsProcessingInstructionsToDomRoot() throws Exception {
final Iterable<Directive> dirs = new Directives(
"XPATH '/'; PI 'alpha' 'beta \u20ac'; ADD 'x4';"
"XPATH '/'; PI 'alpha', 'beta \u20ac'; ADD 'x4';"
);
final Document dom = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().newDocument();
Expand All @@ -103,7 +103,7 @@ void addsProcessingInstructionsToDomRoot() throws Exception {
@Test
void prependsProcessingInstructionsToDomRoot() throws Exception {
MatcherAssert.assertThat(
new Xembler(new Directives("PI 'a' 'b'; ADD 'c';")).xml(),
new Xembler(new Directives("PI 'a', 'b'; ADD 'c';")).xml(),
Matchers.containsString("<?a b?><c/>")
);
}
Expand Down

0 comments on commit 001bfee

Please sign in to comment.