Commit c8922bb1 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen
Browse files

Output that test-markup is expected to produce when run on the valid

2006-05-28  Matthias Clasen  <mclasen@redhat.com>

	* tests/markups/expected-*: Output that test-markup
	is expected to produce when run on the valid gmarkup
	examples.

	* tests/markup-test.c: Only dump the results of the
	first, unchunked parse, to compare it against the expected
	output.

	* tests/run-markup-tests.sh: For valid examples, compare
	the output of test-markup against the corresponding
	expected-<n> file.
parent 2585e9aa
2006-05-28 Matthias Clasen <mclasen@redhat.com>
* tests/markups/expected-*: Output that test-markup
is expected to produce when run on the valid gmarkup
examples.
* tests/markup-test.c: Only dump the results of the
first, unchunked parse, to compare it against the expected
output.
* tests/run-markup-tests.sh: For valid examples, compare
the output of test-markup against the corresponding
expected-<n> file.
2006-05-24 Matthias Clasen <mclasen@redhat.com>
* configure.in: Don't compile timeloop on Minix.
......
2006-05-28 Matthias Clasen <mclasen@redhat.com>
* tests/markups/expected-*: Output that test-markup
is expected to produce when run on the valid gmarkup
examples.
* tests/markup-test.c: Only dump the results of the
first, unchunked parse, to compare it against the expected
output.
* tests/run-markup-tests.sh: For valid examples, compare
the output of test-markup against the corresponding
expected-<n> file.
2006-05-24 Matthias Clasen <mclasen@redhat.com>
* configure.in: Don't compile timeloop on Minix.
......
......@@ -54,10 +54,10 @@ end_element_handler (GMarkupParseContext *context,
--depth;
indent (0);
printf ("END '%s'\n", element_name);
}
}
static void
text_handler (GMarkupParseContext *context,
text_handler (GMarkupParseContext *context,
const gchar *text,
gsize text_len,
gpointer user_data,
......@@ -88,7 +88,7 @@ error_handler (GMarkupParseContext *context,
fprintf (stderr, " %s\n", error->message);
}
static GMarkupParser parser = {
static const GMarkupParser parser = {
start_element_handler,
end_element_handler,
text_handler,
......@@ -96,6 +96,14 @@ static GMarkupParser parser = {
error_handler
};
static const GMarkupParser silent_parser = {
NULL,
NULL,
NULL,
NULL,
error_handler
};
static int
test_in_chunks (const gchar *contents,
gint length,
......@@ -104,7 +112,7 @@ test_in_chunks (const gchar *contents,
GMarkupParseContext *context;
int i = 0;
context = g_markup_parse_context_new (&parser, 0, NULL, NULL);
context = g_markup_parse_context_new (&silent_parser, 0, NULL, NULL);
while (i < length)
{
......
PASS '<!-- Comment -->'
PASS '<?PI ?>'
ELEMENT 'foobar'
TEXT '
'
ELEMENT 'e1'
TEXT 'Hi & this is some text inside an element Two 'E' chars as character refs: E E and some 'J': J J'
END 'e1'
TEXT '
'
ELEMENT 'e2:foo'
TEXT ' Text '
ELEMENT 'childfree'
END 'childfree'
TEXT ' with some '
ELEMENT 'nested'
TEXT 'nested elements'
END 'nested'
TEXT ' and entities "& < >> ' and whitespace '
END 'e2:foo'
TEXT '
'
ELEMENT 'tag'
ab="fo<o"
bar="foo"
baz="blah"
TEXT 'This element has attributes'
END 'tag'
TEXT '
'
ELEMENT 'nochildren'
a="b"
xyz="qrs"
END 'nochildren'
TEXT '
'
END 'foobar'
ELEMENT 'foo'
bar="baz"
bar2="baz2"
bar3="baz3"
TEXT 'data'
END 'foo'
ELEMENT 'foo'
TEXT 'data'
END 'foo'
ELEMENT 'foobar'
TEXT '
Παν語
This is a list of ways to say hello in various languages. Its purpose is to illustrate a number of scripts.
(Converted into UTF-8)
---------------------------------------------------------
Arabic السلام عليكم
Czech (česky) Dobrý den
Danish (Dansk) Hej, Goddag
English Hello
Esperanto Saluton
Estonian Tere, Tervist
FORTRAN PROGRAM
Finnish (Suomi) Hei
French (Français) Bonjour, Salut
German (Deutsch Nord) Guten Tag
German (Deutsch Süd) Grüß Gott
Greek (Ελληνικά) Γειά σας
Hebrew שלום
Hindi नमस्ते, नमस्कार।
Italiano Ciao, Buon giorno
Maltese Ċaw, Saħħa
Nederlands, Vlaams Hallo, Dag
Norwegian (Norsk) Hei, God dag
Polish Dzień dobry, Hej
Russian (Русский) Здравствуйте!‎
Slovak Dobrý deň
Spanish (Español) ‎¡Hola!‎
Swedish (Svenska) Hej, Goddag
Thai (ภาษาไทย) สวัสดีครับ, สวัสดีค่ะ
Turkish (Türkçe) Merhaba
Vietnamese (Tiếng Việt) Xin Chào
Yiddish (ײַדישע) דאָס הײַזעלע
Japanese (日本語) こんにちは, コンニチハ
Chinese (中文,普通话,汉语) 你好
Cantonese (粵語,廣東話) 早晨, 你好
Korean (한글) 안녕하세요, 안녕하십니까
Difference among chinese characters in GB, JIS, KSC, BIG5:‎
GB -- 元气 开发
JIS -- 元気 開発
KSC -- 元氣 開發
BIG5 -- 元氣 開發
'
END 'foobar'
ELEMENT 'foo'
TEXT '
'
ELEMENT 'bar'
a="1"
END 'bar'
TEXT '
'
ELEMENT 'bar'
a="1"
b="2"
END 'bar'
TEXT '
'
ELEMENT 'bar'
a="1"
b="2"
c="3"
END 'bar'
TEXT '
'
ELEMENT 'bar'
a="1"
b="2"
c="3"
d="4"
END 'bar'
TEXT '
'
ELEMENT 'bar'
a="1"
b="2"
c="3"
d="4"
e="5"
END 'bar'
TEXT '
'
ELEMENT 'bar'
a="1"
b="2"
c="3"
d="4"
e="5"
f="6"
END 'bar'
TEXT '
'
ELEMENT 'bar'
a="1"
b="2"
c="3"
END 'bar'
TEXT '
'
ELEMENT 'bar'
a="1"
END 'bar'
TEXT '
'
END 'foo'
ELEMENT 'foo'
TEXT '
'
ELEMENT 'bar'
a="1"
END 'bar'
TEXT '
'
ELEMENT 'bar'
a="2"
END 'bar'
TEXT '
'
ELEMENT 'bar'
a="3""
END 'bar'
TEXT '
'
ELEMENT 'bar'
a="4'"
END 'bar'
TEXT '
'
ELEMENT 'bar'
a="5''''"
END 'bar'
TEXT '
'
END 'foo'
PASS '<?xml version="1.0" ?>'
ELEMENT 'foo'
TEXT ''
END 'foo'
PASS '<!DOCTYPE foo "foo" [
<!ELEMENT foo ANY >
]>'
ELEMENT 'foo'
TEXT ''
END 'foo'
PASS '<!-- a comment -->'
ELEMENT 'foo'
TEXT ''
END 'foo'
ELEMENT 'foo'
TEXT ''
PASS '<![CDATA[ some <<<<>>>> CDATA ]]>'
TEXT ''
END 'foo'
ELEMENT 'foo'
TEXT 'data'
END 'foo'
......@@ -17,7 +17,7 @@ error_out=/dev/null
if [ "$1" = "-v" ]; then
verbose=1
error_out=/dev/stderr
fi
fi
for I in ${srcdir:-.}/markups/fail-*.gmarkup; do
echo_v "Parsing $I, should fail"
./markup-test $I > /dev/null 2> $error_out && fail "failed to generate error on $I"
......@@ -26,9 +26,14 @@ for I in ${srcdir:-.}/markups/fail-*.gmarkup; do
fi
done
for I in ${srcdir:-.}/markups/valid-*.gmarkup; do
echo_v "Parsing $I, should succeed"
./markup-test $I > /dev/null 2> $error_out || fail "failed on $I"
for (( I=1 ; I < 100 ; I++ )) ; do
F=${srcdir:-.}/markups/valid-$I.gmarkup
if [ -f $F ] ; then
echo_v "Parsing $F, should succeed"
./markup-test $F > actual 2> $error_out || fail "failed on $F"
diff -u ${srcdir:-.}/markups/expected-$I actual || fail "unexpected output on $F"
rm actual
fi
done
echo_v "All tests passed."
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