summaryrefslogtreecommitdiffstats
path: root/test/xml/encoded-char
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:48:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:48:59 +0000
commitc484829272cd13a738e35412498e12f2c9a194ac (patch)
treea1f5ec09629ee895bd3963fa8820b45f2f4c574b /test/xml/encoded-char
parentInitial commit. (diff)
downloadliborcus-upstream/0.19.2.tar.xz
liborcus-upstream/0.19.2.zip
Adding upstream version 0.19.2.upstream/0.19.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/xml/encoded-char')
-rw-r--r--test/xml/encoded-char/check.txt19
-rw-r--r--test/xml/encoded-char/input.xml11
2 files changed, 30 insertions, 0 deletions
diff --git a/test/xml/encoded-char/check.txt b/test/xml/encoded-char/check.txt
new file mode 100644
index 0000000..5aba73d
--- /dev/null
+++ b/test/xml/encoded-char/check.txt
@@ -0,0 +1,19 @@
+/root
+/root/data
+/root/data"Tom & Jerry"
+/root/data
+/root/data@attr="Black & Whilte"
+/root/data@attr2="'quoted'"
+/root/data"This is 'single-quoted', and this is \"double-quoted\"."
+/root/data
+/root/data@attr="<>'\"&"
+/root/data"Less than (<) and greater than (>) are also encoded."
+/root/data
+/root/data"<>'\"&"
+/root/data
+/root/data@single-char="&"
+/root/data">"
+/root/data
+/root/data"\"B\";"
+/root/data
+/root/data"\";\""
diff --git a/test/xml/encoded-char/input.xml b/test/xml/encoded-char/input.xml
new file mode 100644
index 0000000..289fc57
--- /dev/null
+++ b/test/xml/encoded-char/input.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Test for correctly converting encoded characters. -->
+<root>
+ <data>Tom &amp; Jerry</data>
+ <data attr="Black &amp; Whilte" attr2="&apos;quoted&apos;">This is &apos;single-quoted&apos;, and this is &quot;double-quoted&quot;.</data>
+ <data attr="&lt;&gt;&apos;&quot;&amp;">Less than (&lt;) and greater than (&gt;) are also encoded.</data>
+ <data>&lt;&gt;&apos;&quot;&amp;</data>
+ <data single-char="&amp;">&gt;</data>
+ <data>&quot;B&quot;;</data>
+ <data>&quot;;&quot;</data>
+</root>