Add Failing Test

issue: #257
This commit is contained in:
Josh Johnson 2019-05-31 23:10:43 -04:00
parent c743d032f9
commit d68dbe8a22
4 changed files with 43 additions and 2 deletions

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "xml",
"version": "2.3.2",
"version": "2.4.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -44,7 +44,7 @@ describe("V2XmlFormatter", () => {
testFormatter(xmlFormatter, options, "preformatted");
});
it ("should preserve line breaks between elements", () => {
it("should preserve line breaks between elements", () => {
testFormatter(xmlFormatter, options, "preserve-breaks");
});
@ -95,6 +95,10 @@ describe("V2XmlFormatter", () => {
it("should not remove spaces between the node name and the first attribute within CDATA", () => {
testFormatter(xmlFormatter, options, "issue-227");
});
it("should handle mixed content as a child of another element", () => {
testFormatter(xmlFormatter, options, "issue-257");
});
});
});

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<file>
<xsl:apply-templates />
</file>
</xsl:template>
<xsl:template match="*">
<xsl:message terminate="no">
WARNING: Unmatched element: <xsl:value-of select="name()" />
</xsl:message>
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<file>
<xsl:apply-templates />
</file>
</xsl:template>
<xsl:template match="*">
<xsl:message terminate="no">
WARNING: Unmatched element: <xsl:value-of select="name()"/>
</xsl:message>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>