finds, and added upper case versions of locale names to each test.
This should allow the tests to succeed on old Solaris.
}
# Skip test if none of the offered locales are supported.
+# As side effect, use the first locale that is found. Note that
+# some platforms allow, by way of example, en_US.UTF-8 to be used
+# even though en_US.UTF8 is listed by locale -a. But by setting
+# LC_ALL here, we don't rely on that.
require_locale ()
{
for locale in "$@"; do
if locale -a | grep -i "$locale" >/dev/null; then
+ LC_ALL="$locale"; export LC_ALL
return
fi
done
# Check that dist encodes headers using RFC-2047 properly
#
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
cat >"$expected" <<EOF
From: Test1 <test1@example.com>
setup_test
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
draft="$MH_TEST_DIR/$$.draft"
backup="${MH_TEST_DIR}/`mhparam sbackup`$$.draft.orig"
set -e
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
draft="$MH_TEST_DIR/$$.draft"
backup="${MH_TEST_DIR}/`mhparam sbackup`$$.draft.orig"
setup_test
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
draft="$MH_TEST_DIR/$$.draft"
backup="${MH_TEST_DIR}/`mhparam sbackup`$$.draft.orig"
#
# We're going to hardcode UTF-8 for this test.
#
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
#
# Basic test of encoding a short subject
expected="$MH_TEST_DIR/$$.expected"
actual="$MH_TEST_DIR/$$.actual"
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
#### Rely on sendmail/pipe below to override default mts.
mts_fakesendmail="${MHMTSCONF}-fakesendmail"
setup_test
#### Make sure that html-to-text conversion is what we expect.
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
expected="$MH_TEST_DIR/test-mhfixmsg$$.expected"
expected_err="$MH_TEST_DIR/test-mhfixmsg$$.expected_err"
setup_test
#### Make sure that html-to-text conversion is what we expect.
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
#### Disable colorized output.
TERM=dumb; export TERM
mhl="${MH_LIBEXEC_DIR}/mhl"
#### Make sure that html-to-text conversion is what we expect.
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
# check UTF-8 headers
setup_test
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
expected=$MH_TEST_DIR/$$.expected
actual=$MH_TEST_DIR/$$.actual
setup_test
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
test "$ICONV_ENABLED" -eq 0 && text_size=10 || text_size=11
test_skip 'test-textcharset requires that nmh have been built with iconv'
fi
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
expected="$MH_TEST_DIR"/$$.expected
actual="$MH_TEST_DIR"/$$.actual
set +e
-require_locale en_US.utf-8 en_US.utf8
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
# Don't use run_prog here because it loses the environment setting.
-LC_ALL=en_US.UTF-8 pick -subject foobar 13 >"$actual" 2>&1
+pick -subject foobar 13 >"$actual" 2>&1
set -e
check "$expected" "$actual"
SMTPUTF8=1; export SMTPUTF8
#### Make sure that html-to-text conversion is what we expect.
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
#### Enable EAI in mhbuild, via the profile.
sed "s%^\(mhbuild: .*\)%\1 -headerencoding utf-8%" "$MH" >"$MH.new"
#### Make sure that this works with 8-bit encoding.
finish_test
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
# check -convertarg with multiple parts, 7 bit
--- /dev/null
+#!/bin/sh
+######################################################
+#
+# Test scan with Local-Mailbox set.
+#
+######################################################
+
+if test -z "${MH_OBJ_DIR}"; then
+ srcdir=`dirname "$0"`/../..
+ MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
+fi
+
+. "$MH_OBJ_DIR/test/common.sh"
+
+setup_test
+
+# est1@example.com is a substring of test1@example.com; the latter
+# should not be considered a match for the former (causing 'To:Some
+# User' to be printed instead of 'Test1').
+echo 'Local-Mailbox: est1@example.com' >> "$MH"
+
+expected="$MH_TEST_DIR/$$.expected"
+actual="$MH_TEST_DIR/$$.actual"
+
+cat >"$expected" <<EOF
+ 1 09/29 Test1 Testing message 1<<This is message number 1 >>
+ 2 09/29 Test2 Testing message 2<<This is message number 2 >>
+ 3 09/29 Test3 Testing message 3<<This is message number 3 >>
+ 4 09/29 Test4 Testing message 4<<This is message number 4 >>
+ 5 09/29 Test5 Testing message 5<<This is message number 5 >>
+ 6 09/29 Test6 Testing message 6<<This is message number 6 >>
+ 7 09/29 Test7 Testing message 7<<This is message number 7 >>
+ 8 09/29 Test8 Testing message 8<<This is message number 8 >>
+ 9 09/29 Test9 Testing message 9<<This is message number 9 >>
+ 10 09/29 Test10 Testing message 10<<This is message number 10 >>
+EOF
+
+run_prog scan +inbox -width 80 >"$actual" || exit 1
+check "$expected" "$actual"
+
+exit $failed
test_skip "configure did not detect multibyte support"
fi
-require_locale en_US.utf-8 en_US.utf8
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
#
# Create a test message with RFC 2047 headers we can scan