From: markus schnalke Date: Wed, 31 Oct 2018 10:32:39 +0000 (+0100) Subject: Add test for empty sequence patch by c_14 X-Git-Tag: mmh-0.4~21 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=410e6cccd38f176e9df34e5565d04f6f96c7e815 Add test for empty sequence patch by c_14 i.e. for commit 850190587ff71010fc63e44ca01a93a44c96f58e --- diff --git a/test/tests/new/test-empty-seq b/test/tests/new/test-empty-seq new file mode 100644 index 0000000..f134f27 --- /dev/null +++ b/test/tests/new/test-empty-seq @@ -0,0 +1,44 @@ +#!/bin/sh + +# TODO: Move to a common file tests can source; need more framework... +failed=0 +check() { + diff -u $expected $actual + if [ $? -ne 0 ]; then + failed=$((failed + 1)) + fi +} + +folders=$MH_TEST_DIR/Mail/.folders + +expected=$MH_TEST_DIR/$$.expected +actual=$MH_TEST_DIR/$$.actual + +# make second folder +cp -r $MH_TEST_DIR/Mail/inbox $MH_TEST_DIR/Mail/foo1 +cp -r $MH_TEST_DIR/Mail/inbox $MH_TEST_DIR/Mail/foo2 +# but only list inbox and foo2 in .folders, and sorted differently +cat > $folders <>"$MH_TEST_DIR/Mail/foo2/.mh_sequences" + +# test with the empty sequence +cat > $expected < $actual 2>&1 +check +new -folders $folders empty > $actual 2>&1 +check + +# test fnext/fprev with the empty sequence +> $expected +fnext empty > $actual 2>&1 +check +fprev empty > $actual 2>&1 +check +