mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Merge with git+ssh://pasky.or.cz/srv/git/elinks.git
This commit is contained in:
commit
de468660f1
@ -17,17 +17,11 @@ test_normalize_output_equals () {
|
|||||||
src="$1"; shift
|
src="$1"; shift
|
||||||
out="$1"; shift
|
out="$1"; shift
|
||||||
|
|
||||||
URI="test:$(echo "$desc" | sed '
|
URI="test:$(normalize "$desc")"
|
||||||
s/^[ \t]*\[[^]]*\][ \t]*//;
|
|
||||||
s/[:., \t][:., \t]*/-/g;
|
|
||||||
s/_/-/g;
|
|
||||||
# *cough*
|
|
||||||
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;
|
|
||||||
s/[^a-zA-Z0-9-]//g;')"
|
|
||||||
|
|
||||||
sgml-parser --src "$src" --normalize "$config" --uri "$URI" --src "$src" | sed 's/^ //' > output
|
sgml-parser --src "$src" --normalize "$config" --uri "$URI" --src "$src" > output
|
||||||
echo "#document: $URI" > expected
|
echo "#document: $URI" > expected
|
||||||
echo "$out" | sed -n '2,$p' >> expected
|
echo "$out" | sed -n '2,$p' | sed 's/^/ /' >> expected
|
||||||
|
|
||||||
test_expect_success "$desc" 'cmp output expected'
|
test_expect_success "$desc" 'cmp output expected'
|
||||||
}
|
}
|
||||||
|
@ -16,17 +16,11 @@ test_output_equals () {
|
|||||||
src="$1"; shift
|
src="$1"; shift
|
||||||
out="$1"; shift
|
out="$1"; shift
|
||||||
|
|
||||||
URI="test:$(echo "$desc" | sed '
|
URI="test:$(normalize "$desc")"
|
||||||
s/^[ \t]*\[[^]]*\][ \t]*//;
|
|
||||||
s/[:., \t][:., \t]*/-/g;
|
|
||||||
s/_/-/g;
|
|
||||||
# *cough*
|
|
||||||
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;
|
|
||||||
s/[^a-zA-Z0-9-]//g;')"
|
|
||||||
|
|
||||||
sgml-parser --uri "$URI" --src "$src" | sed 's/^ //' > output
|
sgml-parser --uri "$URI" --src "$src" > output
|
||||||
echo "#document: $URI" > expected
|
echo "#document: $URI" > expected
|
||||||
echo "$out" | sed -n '2,$p' >> expected
|
echo "$out" | sed -n '2,$p' | sed 's/^/ /' >> expected
|
||||||
|
|
||||||
test_expect_success "$desc" 'cmp output expected'
|
test_expect_success "$desc" 'cmp output expected'
|
||||||
}
|
}
|
||||||
|
@ -16,20 +16,13 @@ test_incremental_parsing () {
|
|||||||
src="$1"; shift
|
src="$1"; shift
|
||||||
out="$1"; shift
|
out="$1"; shift
|
||||||
|
|
||||||
URI="test:$(echo "$desc" | sed '
|
URI="test:$(normalize "$desc")"
|
||||||
s/^[ \t]*\[[^]]*\][ \t]*//;
|
|
||||||
s/[:., \t][:., \t]*/-/g;
|
|
||||||
s/_/-/g;
|
|
||||||
# *cough*
|
|
||||||
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;
|
|
||||||
s/[^a-zA-Z0-9-]//g;')"
|
|
||||||
|
|
||||||
echo "#document: $URI" > expected
|
echo "#document: $URI" > expected
|
||||||
echo "$out" | sed -n '2,$p' >> expected
|
echo "$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
|
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" \
|
echo -n "$src" | sgml-parser --uri "$URI" --stdin "$size" > output
|
||||||
| sed -e 's/^ //' > output
|
|
||||||
|
|
||||||
test_run_ 'cmp output expected'
|
test_run_ 'cmp output expected'
|
||||||
if [ "$?" != 0 -o "$eval_ret" != 0 ]
|
if [ "$?" != 0 -o "$eval_ret" != 0 ]
|
||||||
|
@ -15,7 +15,7 @@ export LANG LC_ALL PAGER TZ
|
|||||||
# test_description='Description of this test...
|
# test_description='Description of this test...
|
||||||
# This test checks if command xyzzy does the right thing...
|
# This test checks if command xyzzy does the right thing...
|
||||||
# '
|
# '
|
||||||
# . ./test-lib.sh
|
# . "$TEST_LIB
|
||||||
|
|
||||||
error () {
|
error () {
|
||||||
echo "* error: $*"
|
echo "* error: $*"
|
||||||
@ -27,6 +27,17 @@ say () {
|
|||||||
echo "* $*"
|
echo "* $*"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
normalize () {
|
||||||
|
echo "$@" | sed '
|
||||||
|
s/^[ \t]*\[[^]]*\][ \t]*//;
|
||||||
|
s/[:., \t][:., \t]*/-/g;
|
||||||
|
s/_/-/g;
|
||||||
|
# *cough*
|
||||||
|
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;
|
||||||
|
s/[^a-zA-Z0-9-]//g;'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
test "${test_description}" != "" ||
|
test "${test_description}" != "" ||
|
||||||
error "Test script did not set test_description."
|
error "Test script did not set test_description."
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user