X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=test%2Fformat%2Ftest-myname;h=dda0f37bf8cb8e79092f5d2c2597a4702478e224;hb=348afa78cbece5f8eb67a120282c50b469fa9849;hp=dc86ea5e45aadf3f64cd1aea99d205b616269311;hpb=4d6cfbb1c9b425cb693e5189a19e132c67f5494a;p=mmh diff --git a/test/format/test-myname b/test/format/test-myname index dc86ea5..dda0f37 100755 --- a/test/format/test-myname +++ b/test/format/test-myname @@ -4,6 +4,8 @@ # the Signature profile entry, and via SIGNATURE environment variable. # +set -e + if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR @@ -13,19 +15,45 @@ fi setup_test -unset SIGNATURE +unset SIGNATURE +fullname=`${MH_OBJ_DIR}/test/getfullname` run_test "${MH_LIB_DIR}/ap -format %(myname) ignore" \ - "`${MH_OBJ_DIR}/test/getfullname`" "GECOS field test" + "$fullname" "GECOS field test" echo "Signature: Some Random Name 1" >> ${MH} run_test "${MH_LIB_DIR}/ap -format %(myname) ignore" \ "Some Random Name 1" "MH Profile Signature test" -export SIGNATURE="Some Random Name 2" +SIGNATURE="Some Random Name 2" +export SIGNATURE run_test "${MH_LIB_DIR}/ap -format %(myname) ignore" \ "${SIGNATURE}" "SIGNATURE Environment test" +#### Test escaping of display names. +escape="${MH_OBJ_DIR}/test/getfullname" +run_test "$escape "'user' 'user' 'no escape' +run_test "$escape "'first.last' '"first.last"' 'escape' +run_test "$escape "'"first.last"' '"first.last"' 'already escaped' +run_test "$escape "'first.last"' '"first.last"' 'missing initial "' +run_test "$escape "'"first.last' '"first.last"' 'missing final "' +run_test "$escape "'embedded"quote' '"embedded\"quote"' 'embedded quote' +run_test "$escape "'server\name,#' '"server\name"' 'Windows form' +run_test "$escape "'"' '"\""' 'special "' +run_test "$escape "'(' '"("' 'special (' +run_test "$escape "')' '")"' 'special )' +#### We stop at the first comma so this one gets eliminated: +run_test "$escape "',' '' 'special ,' +run_test "$escape "'.' '"."' 'special .' +run_test "$escape "':' '":"' 'special :' +run_test "$escape "';' '";"' 'special ;' +run_test "$escape "'<' '"<"' 'special <' +run_test "$escape "'>' '">"' 'special >' +run_test "$escape "'@' '"@"' 'special @' +run_test "$escape "'[' '"["' 'special [' +run_test "$escape "'\\' '"\\"' 'special \\' +run_test "$escape "']' '"]"' 'special ]' + exit $failed