about summary refs log tree commit diff
path: root/t
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2023-03-16 19:54:46 +0100
committerLeah Neukirchen <leah@vuxu.org>2023-03-16 19:54:46 +0100
commit1838158ef19d489e554b3460059fba47d26ba145 (patch)
treeb4e446f1bb93665cf574ef25bc40725969e66775 /t
parentcccf01cb9aa45769e2e9d41c1e8e98a6502a98e0 (diff)
downloadmblaze-1838158ef19d489e554b3460059fba47d26ba145.tar.gz
mblaze-1838158ef19d489e554b3460059fba47d26ba145.tar.xz
mblaze-1838158ef19d489e554b3460059fba47d26ba145.zip
blaze822_priv.h: use proper lc/uc
Mail headers may contain characters where the simple definition breaks,
which results in wrong formatting on output.

Fixes #235.
Diffstat (limited to 't')
-rwxr-xr-xt/1100-mhdr.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/1100-mhdr.t b/t/1100-mhdr.t
new file mode 100755
index 0000000..9937041
--- /dev/null
+++ b/t/1100-mhdr.t
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+cd ${0%/*}
+. ./lib.sh
+
+plan 9
+
+cat <<EOF >tmp
+Header: foo
+Header2: bar
+Header-Three: quux
+Header_Four: ding
+
+Body
+EOF
+
+check_same 'Header' 'mhdr -h Header ./tmp' 'echo foo'
+check_same 'Header2' 'mhdr -h Header2 ./tmp' 'echo bar'
+check_same 'Header-Three' 'mhdr -h Header-Three ./tmp' 'echo quux'
+check_same 'Header_Four' 'mhdr -h Header_Four ./tmp' 'echo ding'
+
+check_same 'header' 'mhdr -h header ./tmp' 'echo foo'
+check_same 'header2' 'mhdr -h header2 ./tmp' 'echo bar'
+check_same 'header-Three' 'mhdr -h header-Three ./tmp' 'echo quux'
+check_same 'header_Four' 'mhdr -h header_Four ./tmp' 'echo ding'
+
+check 'issue 235' 'mhdr ./tmp |grep -i header_four'