[glib] Add a few tests for G_MARKUP_TREAT_CDATA_AS_TEXT
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Add a few tests for G_MARKUP_TREAT_CDATA_AS_TEXT
- Date: Mon, 3 Mar 2014 00:10:56 +0000 (UTC)
commit 79caa3a7e151897b062f82251eec207bc1514ff3
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Mar 2 19:10:00 2014 -0500
Add a few tests for G_MARKUP_TREAT_CDATA_AS_TEXT
Related to
https://bugzilla.gnome.org/show_bug.cgi?id=725433
glib/tests/Makefile.am | 9 +++++-
glib/tests/markups/valid-16.cdata-as-text | 42 +++++++++++++++++++++++++++++
glib/tests/markups/valid-16.expected | 42 +++++++++++++++++++++++++++++
glib/tests/markups/valid-16.gmarkup | 10 +++++++
glib/tests/markups/valid-8.cdata-as-text | 5 +++
5 files changed, 107 insertions(+), 1 deletions(-)
---
diff --git a/glib/tests/Makefile.am b/glib/tests/Makefile.am
index daf4229..445040a 100644
--- a/glib/tests/Makefile.am
+++ b/glib/tests/Makefile.am
@@ -146,10 +146,17 @@ markup_tests = \
valid-1 valid-2 valid-3 valid-4 valid-5 \
valid-6 valid-7 valid-8 valid-9 valid-10 \
valid-11 valid-12 valid-13 valid-14 valid-15 \
+ valid-16 \
+ $(NULL)
+
+cdata_markup_tests = \
+ valid-8 valid-16 \
$(NULL)
dist_test_data += $(all_markup_data)
-all_markup_data = $(addprefix markups/,$(markup_tests:=.gmarkup) $(markup_tests:=.expected))
+all_markup_data = \
+ $(addprefix markups/,$(markup_tests:=.gmarkup) $(markup_tests:=.expected)) \
+ $(addprefix markups/,$(cdata_markup_tests.=.cdata-as-text))
# -----------------------------------------------------------------------------
diff --git a/glib/tests/markups/valid-16.cdata-as-text b/glib/tests/markups/valid-16.cdata-as-text
new file mode 100644
index 0000000..ef35ffc
--- /dev/null
+++ b/glib/tests/markups/valid-16.cdata-as-text
@@ -0,0 +1,42 @@
+ELEMENT 'a'
+ TEXT '
+ '
+ ELEMENT 'b'
+ TEXT '
+ '
+ ELEMENT 'c1'
+ TEXT 'c1'
+ END 'c1'
+ TEXT '
+ '
+ ELEMENT 'c2'
+ TEXT 'c2'
+ END 'c2'
+ TEXT '
+ '
+ END 'b'
+ TEXT '
+ '
+ ELEMENT 'b1'
+ TEXT 'b1'
+ END 'b1'
+ TEXT '
+ '
+ ELEMENT 'b2'
+ TEXT 'b2'
+ END 'b2'
+ TEXT '
+ '
+ ELEMENT 'b3'
+ TEXT 'b3'
+ END 'b3'
+ TEXT '
+ '
+ ELEMENT 'b4'
+ TEXT ''
+ TEXT 'This is CDATA'
+ TEXT ''
+ END 'b4'
+ TEXT '
+'
+END 'a'
diff --git a/glib/tests/markups/valid-16.expected b/glib/tests/markups/valid-16.expected
new file mode 100644
index 0000000..c9eca19
--- /dev/null
+++ b/glib/tests/markups/valid-16.expected
@@ -0,0 +1,42 @@
+ELEMENT 'a'
+ TEXT '
+ '
+ ELEMENT 'b'
+ TEXT '
+ '
+ ELEMENT 'c1'
+ TEXT 'c1'
+ END 'c1'
+ TEXT '
+ '
+ ELEMENT 'c2'
+ TEXT 'c2'
+ END 'c2'
+ TEXT '
+ '
+ END 'b'
+ TEXT '
+ '
+ ELEMENT 'b1'
+ TEXT 'b1'
+ END 'b1'
+ TEXT '
+ '
+ ELEMENT 'b2'
+ TEXT 'b2'
+ END 'b2'
+ TEXT '
+ '
+ ELEMENT 'b3'
+ TEXT 'b3'
+ END 'b3'
+ TEXT '
+ '
+ ELEMENT 'b4'
+ TEXT ''
+ PASS '<![CDATA[This is CDATA]]>'
+ TEXT ''
+ END 'b4'
+ TEXT '
+'
+END 'a'
diff --git a/glib/tests/markups/valid-16.gmarkup b/glib/tests/markups/valid-16.gmarkup
new file mode 100644
index 0000000..0b67964
--- /dev/null
+++ b/glib/tests/markups/valid-16.gmarkup
@@ -0,0 +1,10 @@
+<a>
+ <b>
+ <c1>c1</c1>
+ <c2>c2</c2>
+ </b>
+ <b1>b1</b1>
+ <b2>b2</b2>
+ <b3>b3</b3>
+ <b4><![CDATA[This is CDATA]]></b4>
+</a>
diff --git a/glib/tests/markups/valid-8.cdata-as-text b/glib/tests/markups/valid-8.cdata-as-text
new file mode 100644
index 0000000..e4c4639
--- /dev/null
+++ b/glib/tests/markups/valid-8.cdata-as-text
@@ -0,0 +1,5 @@
+ELEMENT 'foo'
+ TEXT ''
+ TEXT ' some <<<<>>>> CDATA '
+ TEXT ''
+END 'foo'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]