1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Revert "Refactor test-sgml-parser-basic to work with non-bash shells"

This reverts commit 3f93148c9b.
This commit is contained in:
Jonas Fonseca 2007-05-26 10:26:38 +02:00
parent 1154021242
commit 113077ce00

View File

@ -11,28 +11,18 @@ correctly in the DOM tree.
. "$TEST_LIB"
test_output_equals_file () {
desc="$1"; shift
src="$1"; shift
file="$1"; shift
URI="test:$(normalize "$desc")"
sgml-parser --uri "$URI" --src "$src" > output
echo "#document: $URI" > expected
sed 's/^/ /' < "$file" >> expected
test_expect_success "$desc" 'cmp output expected'
}
test_output_equals () {
desc="$1"; shift
src="$1"; shift
out="$1"; shift
echo "$out" | sed -n '2,$p' > expected+
URI="test:$(normalize "$desc")"
test_output_equals_file "$desc" "$src" "expected+"
sgml-parser --uri "$URI" --src "$src" > output
echo "#document: $URI" > expected
echo "$out" | sed -n '2,$p' | sed 's/^/ /' >> expected
test_expect_success "$desc" 'cmp output expected'
}
@ -194,21 +184,18 @@ entity-reference: #
#text: -
entity-reference: #xx'
cat > expected2 <<EOF
proc-instruction: xml -> encoding="UTF8"
attribute: encoding -> UTF8
#text: \\n...\\n
proc-instruction: ecmascript -> var val=2;\\n
EOF
test_output_equals_file \
test_output_equals \
'Parse processing instructions.' \
'<?xml encoding="UTF8"?>
...
<?ecmascript
var val=2;
?>' \
expected2
'
proc-instruction: xml -> encoding="UTF8"
attribute: encoding -> UTF8
#text: \n...\n
proc-instruction: ecmascript -> var val=2;\n'
test_output_equals \
'Parse XML processing instructions.' \