2006-01-06 19:48:51 -05:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2005 Jonas Fonseca
|
|
|
|
#
|
|
|
|
|
|
|
|
test_description='Test that incompleteness is correctly detected
|
|
|
|
|
|
|
|
This test checks that the SGML parser correctly finds and reports
|
|
|
|
when a part of the source is incomplete.
|
|
|
|
'
|
|
|
|
|
|
|
|
. "$TEST_LIB"
|
|
|
|
|
|
|
|
test_expect_incomplete () {
|
|
|
|
desc="$1"; shift
|
|
|
|
src="$1"; shift
|
|
|
|
|
2006-01-06 20:14:45 -05:00
|
|
|
sgml-parser --src "$src" --incomplete >/dev/null
|
2006-01-06 19:48:51 -05:00
|
|
|
test_expect_success "$desc" \
|
|
|
|
"test $? = 1"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
################################################################
|
|
|
|
# Check for incompleteness
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete comment. (I)' \
|
|
|
|
'<!-'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete comment. (II)' \
|
|
|
|
'<!-- ... '
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete notation. (I)' \
|
|
|
|
'<!'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete notation. (II)' \
|
|
|
|
'<!D'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete cdata section. (I)' \
|
|
|
|
'<![CDATA[ ... '
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete cdata section. (II)' \
|
|
|
|
'<![CDAT'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete element. (I)' \
|
|
|
|
'<elem...'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete element. (II)' \
|
|
|
|
'<'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete element end. (I)' \
|
|
|
|
'<a></a'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete element end. (II)' \
|
|
|
|
'<a></'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete attribute.' \
|
|
|
|
'<element attr...'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete attribute value.' \
|
|
|
|
'<element attr=...'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete attribute quoted value. (I)' \
|
|
|
|
'<element attr="...'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete attribute quoted value. (II)' \
|
|
|
|
"<element attr='..."
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete processing instruction. (I)' \
|
|
|
|
'<?xml'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete processing instruction. (II)' \
|
|
|
|
'<?xml attr...'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete notation.' \
|
|
|
|
'<!DOCTYPE html PUBLIC ...'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete reference. (I)' \
|
|
|
|
'�'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete reference. (II)' \
|
|
|
|
'&'
|
|
|
|
|
|
|
|
test_expect_incomplete \
|
|
|
|
'Check incomplete text.' \
|
|
|
|
'plain text is always incomplete (if incomplete)'
|
|
|
|
|
|
|
|
test_done
|