Add some more GMarkup tests

This commit is contained in:
Matthias Clasen 2011-10-06 09:01:24 -04:00
parent 08e17ae51b
commit d5a1ca8fd7
24 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1 @@
ERROR Error on line 2 char 1: Invalid UTF-8 encoded text in name - not valid 'abcäöü'

View File

@ -0,0 +1,3 @@
<abc<62><63><EFBFBD>>
abc<EFBFBD><EFBFBD><EFBFBD>
</abc<62><63><EFBFBD>>

View File

@ -0,0 +1 @@
ERROR Error on line 3: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity - escape ampersand as &amp;

View File

@ -0,0 +1,5 @@
<foo bar="ab
cd
&lt
de
fg"></foo>

View File

@ -0,0 +1 @@
ERROR Error on line 1 char 10: Odd character '≈', expected a '=' after attribute name 'bar' of element 'foo'

View File

@ -0,0 +1 @@
<foo bar ≈"baz"></foo>

View File

@ -0,0 +1,3 @@
ELEMENT 'foo'
END 'foo'
ERROR Error on line 1 char 6: Odd character '≻', expected a '>' character to end the empty-element tag 'foo'

View File

@ -0,0 +1 @@
<foo/≻

View File

@ -0,0 +1,3 @@
ELEMENT 'foo'
TEXT ''
ERROR Error on line 1 char 12: '≻' is not a valid character following the close element name 'foo'; the allowed character is '>'

View File

@ -0,0 +1 @@
<foo></foo ≻

View File

@ -0,0 +1,2 @@
ELEMENT 'foo'
ERROR Error on line 3 char 2: Document ended unexpectedly with elements still open - 'foo' was the last element opened

View File

@ -0,0 +1,2 @@
<foo>
abc

View File

@ -0,0 +1 @@
ERROR Error on line 1: Failed to parse '', which should have been a digit inside a character reference (&#234; for example) - perhaps the digit is too large

View File

@ -0,0 +1 @@
<foo bar="&#𝐀;"></foo>

View File

@ -0,0 +1 @@
ERROR Error on line 2 char 2: Odd character '>', expected a '=' after attribute name 'bar' of element 'fail'

View File

@ -0,0 +1,2 @@
<fail foo="foo" bar
></foo>

View File

@ -0,0 +1,3 @@
ELEMENT 'foo'
TEXT ''
ERROR Error on line 2 char 2: Document ended unexpectedly inside the close tag for element 'foo'

View File

@ -0,0 +1 @@
<foo></foo

View File

@ -0,0 +1,5 @@
ELEMENT 'abcäöü'
TEXT '
abcäöü
'
END 'abcäöü'

View File

@ -0,0 +1,3 @@
<abcäöü>
abcäöü
</abcäöü>

View File

@ -0,0 +1,4 @@
ELEMENT 'foo'
bar="a b c d e𝐀"
TEXT ''
END 'foo'

View File

@ -0,0 +1,3 @@
<foo bar="a b
c d
e𝐀"></foo>

View File

@ -0,0 +1,30 @@
ELEMENT 'foo'
TEXT '
'
ELEMENT 'bar'
TEXT '
/* gmarkup.c - Simple XML-like parser
*
* Copyright 2000, 2003 Red Hat, Inc.
* Copyright 2007, 2008 Ryan Lortie <desrt@desrt.ca>
*
* GLib is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* GLib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with GLib; see the file COPYING.LIB. If not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
'
END 'bar'
TEXT '
'
END 'foo'

View File

@ -0,0 +1,24 @@
<foo>
<bar>
/* gmarkup.c - Simple XML-like parser
*
* Copyright 2000, 2003 Red Hat, Inc.
* Copyright 2007, 2008 Ryan Lortie &lt;desrt@desrt.ca&gt;
*
* GLib is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* GLib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with GLib; see the file COPYING.LIB. If not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
</bar>
</foo>