Add a few tests for G_MARKUP_TREAT_CDATA_AS_TEXT

Related to
https://bugzilla.gnome.org/show_bug.cgi?id=725433
This commit is contained in:
Matthias Clasen 2014-03-02 19:10:00 -05:00
parent b93a13bb79
commit 79caa3a7e1
5 changed files with 107 additions and 1 deletions

View File

@ -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))
# -----------------------------------------------------------------------------

View File

@ -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'

View File

@ -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'

View File

@ -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>

View File

@ -0,0 +1,5 @@
ELEMENT 'foo'
TEXT ''
TEXT ' some <<<<>>>> CDATA '
TEXT ''
END 'foo'