aboutsummaryrefslogblamecommitdiffstats
path: root/filters/test.sh
blob: c0d9e6cdff5345a680b09224115e0f4ed3549459 (plain) (tree)
1
2
3
4
5
6





                  
























                                       
                       

















                                                                     
#!/bin/sh

set -e

here=$(dirname $0)
fail=0
style=$(mktemp)
trap "rm -f $style" EXIT
cat >$style <<EOF
# stuff

url.fg = red

[viewer]
url.underline = true
header.bold=    true
signature.dim=true
diff_meta.bold    =true
diff_chunk.dim=		true
invalid . xxx = lkjfdslkjfdsqqqqqlkjdsq
diff_add.fg=2
# comment
diff_del.fg=     1
quote_*.fg     =6
quote_*.dim=true
quote_1.dim=false

[user]
foo = bar
EOF
export AERC_STYLESET=$style
export AERC_OSC8_URLS=1

for vec in $here/vectors/*.in; do
	tool=$(basename $vec | sed 's/-.*//')
	expected=${vec%%.in}.expected
	tmp=$(mktemp)
	if ! $FILTERS_TEST_PREFIX $here/../$tool -f $vec > $tmp; then
		fail=1
	fi
	if diff -u "$expected" "$tmp"; then
		echo "ok      $tool < $vec > $tmp"
	else
		echo "error   $tool < $vec > $tmp"
		fail=1
	fi
	rm -f -- "$tmp"
done

exit $fail