Commit e00dade3 authored by mrodzis's avatar mrodzis 🌎
Browse files

Update test (closes #16)

parent bf5ebe82
project.name=http://bdn-edition.de/ns/code-view-develop
project.version=1.1.2
project.version=1.1.3
project.title=Code View
project.abbrev=cv-develop
project.processorversion=4.5.0
......
......@@ -29,15 +29,15 @@ declare
%test:name("Basic: no child nodes, no attributes")
%test:args("<test/>")
%test:assertXPath("$result[self::xhtml:pre]/xhtml:code/xhtml:span[@class=""hljs-tag""]/child::text()[1] = ""&lt;""")
%test:args("<test/>")
%test:assertXPath("$result//xhtml:span[@class=""hljs-tag""]/xhtml:span[@class=""hljs-name""]")
%test:args("<test/>")
%test:assertXPath("$result//xhtml:span[@class=""hljs-name""]/child::text() = ""test""")
%test:args("<test/>")
%test:assertXPath("$result//xhtml:span[@class=""hljs-tag""]/child::text()[last()] = ""/&gt;""")
%test:assertXPath("$result//xhtml:span[@class=""hljs-tag""]/child::text()[last()] = ""/&gt;""")
function cv-test:test-basic-001($node as element(*)) {
code-view:main($node)
};
......@@ -46,14 +46,14 @@ declare
declare
%test:name("Basic: no child nodes, with attribute(s)")
%test:args("<test type=""class""/>")
%test:assertXPath("$result//xhtml:span[@class=""hljs-attr""]/child::text()[1] = ""type""")
%test:assertXPath("$result//xhtml:span[@class=""hljs-attr""]/child::text()[1] = ""type""")
%test:args("<test type=""class""/>")
%test:assertXPath("$result//xhtml:span[@class=""hljs-string""]/child::text()[1][contains(., ""class"")]")
%test:args("<test type=""class""/>")
%test:assertXPath("$result//xhtml:span[@class=""hljs-name""]/following-sibling::text()[1] = "" """)
function cv-test:test-basic-002($node as element(*)) {
code-view:main($node)
};
......@@ -62,10 +62,10 @@ declare
declare
%test:name("Basic: with child node(s)")
%test:args("<test><childnode/></test>")
%test:assertXPath("$result//xhtml:span[@class=""hljs-tag""]/xhtml:span[@class=""hljs-name""]/string() = ""childnode""")
%test:assertXPath("$result//xhtml:span[@class=""hljs-tag""]/xhtml:span[@class=""hljs-name""]/string() = ""childnode""")
%test:args("<test><childnode/></test>")
%test:assertXPath("$result//xhtml:span[@class=""hljs-name""][./string() = ""test""]/following::xhtml:span[@class=""hljs-name""][1]/descendant::text() = ""childnode""")
%test:assertXPath("$result//xhtml:span[@class=""hljs-name""][./string() = ""test""]/following::xhtml:span[@class=""hljs-name""][1]/descendant::text() = ""childnode""")
function cv-test:test-basic-003($node as element(*)) {
code-view:main($node)
};
......@@ -75,10 +75,10 @@ declare
%test:name("Comments: display")
%test:args("<test><!-- test --></test>")
%test:assertXPath("$result//xhtml:span[@class=""hljs-comment""]")
%test:args("<test><!-- test --></test>")
%test:assertXPath("$result//xhtml:span[@class=""hljs-comment""]/child::text() = ""&lt;!-- test --&gt;""")
function cv-test:test-basic-004($node as element(*)) {
code-view:main($node, true(), "hljs-", false())
};
......@@ -88,7 +88,7 @@ declare
%test:name("Comments: don't display")
%test:args("<test><!-- test --></test>")
%test:assertXPath("not($result//xhtml:span[@class=""hljs-comment""])")
function cv-test:test-basic-005($node as element(*)) {
code-view:main($node, false(), "hljs-", false())
};
......@@ -98,7 +98,7 @@ declare
%test:name("Prefix: change")
%test:args("<test><!-- test --></test>")
%test:assertXPath("$result//xhtml:span[@class=""another-prefix-tag""]")
function cv-test:test-basic-006($node as element(*)) {
code-view:main($node, false(), "another-prefix-", false())
};
......@@ -109,13 +109,13 @@ declare
%test:args("<test>
<childnode/>
</test>")
%test:assertXPath("$result//xhtml:span[@class=""hljs-tag""][1]/following::*[1][self::xhtml:span[@class=""hljs-tag""]]")
%test:assertXPath("$result//xhtml:span[@class=""hljs-tag""][1]/following::*[1][self::xhtml:span[@class=""hljs-tag""]]")
%test:args("<test>
<childnode/>
</test>")
%test:assertXPath("not($result//xhtml:span[@class=""hljs-tag""][2]/following::node()[1][matches(., ""[\s]{4}"")])")
function cv-test:test-basic-007($node as element(*)) {
code-view:main($node, false(), "hljs-", true())
};
......@@ -125,7 +125,7 @@ declare
%test:name("Indent: false")
%test:args("<test> <childnode/></test>")
%test:assertXPath("$result//xhtml:span[@class=""hljs-tag""][1]/following::node()[1][matches(., ""[\s]{4}"")]")
function cv-test:test-basic-008($node as element(*)) {
code-view:main($node, false(), "hljs-", false())
};
......@@ -136,7 +136,7 @@ declare
%test:name("hljs example")
%test:args('<title>Title</title>')
%test:assertTrue
%test:assertXPath("deep-equal($result, <xhtml:pre xmlns:xhtml=""http://www.w3.org/1999/xhtml/""><xhtml:code class=""xml hljs""><xhtml:span class=""hljs-tag""><![CDATA[<]]><xhtml:span class=""hljs-name"">title</xhtml:span><![CDATA[>]]></xhtml:span>Title<xhtml:span class=""hljs-tag""><![CDATA[<]]>/<xhtml:span class=""hljs-name"">title</xhtml:span><![CDATA[>]]></xhtml:span></xhtml:code></xhtml:pre>)")
%test:assertXPath("$result//xhtml:span[matches(@class, 'hljs')]")
function cv-test:test-basic-009($node as element(title)) {
code-view:main($node)
};
\ No newline at end of file
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment