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

Use printf to handle test string containing escapes more portable

Works with both bash and dash. This reintroduces the fix to the
test-sgml-parser-basic test, and also fixes test-sgml-parser-incremental
and test-sgml-parser-lines, which Witek has reported as failing.
This commit is contained in:
Jonas Fonseca 2007-05-26 10:42:51 +02:00
parent 113077ce00
commit 17a76257f8
3 changed files with 6 additions and 6 deletions

View File

@ -20,7 +20,7 @@ test_output_equals () {
sgml-parser --uri "$URI" --src "$src" > output
echo "#document: $URI" > expected
echo "$out" | sed -n '2,$p' | sed 's/^/ /' >> expected
printf "%s\n" "$out" | sed -n '2,$p' | sed 's/^/ /' >> expected
test_expect_success "$desc" 'cmp output expected'
}

View File

@ -19,10 +19,10 @@ test_incremental_parsing () {
URI="test:$(normalize "$desc")"
echo "#document: $URI" > expected
echo "$out" | sed -n '2,$p' | sed -e 's/^/ /' >> expected
printf "%s\n" "$out" | sed -n '2,$p' | sed -e 's/^/ /' >> expected
for size in 1 2 3 4 5 6 7 8 9 10 15 20 25 50; do
echo -n "$src" | sgml-parser --uri "$URI" --stdin "$size" > output
printf "%s" "$src" | sgml-parser --uri "$URI" --stdin "$size" > output
test_run_ 'cmp output expected'
if [ "$?" != 0 -o "$eval_ret" != 0 ]

View File

@ -55,10 +55,10 @@ test_output_line_numbers \
7
8' \
8
test_output_line_numbers \
'Check line numbers. (IIII)' \
$'1\r\f 2\v\n 3\r\n 4\t\f 5' \
"$(printf "1\r\f 2\v\n 3\r\n 4\t\f 5")" \
5
test_done