X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/611edee2bfe62872318ad1d355d49512ecce47f3..af2ad7be43057a4f82dc8a223d79d68bf932ae00:/test/mhical/test-mhical diff --git a/test/mhical/test-mhical b/test/mhical/test-mhical index f6d75af0..72c55f5d 100755 --- a/test/mhical/test-mhical +++ b/test/mhical/test-mhical @@ -49,7 +49,7 @@ Usage: mhical [switches] EOF #### Skip nmh intro text. -run_prog mhical -help | sed '/^$/,$d' >"$actual" 2>&1 +run_prog mhical -help 2>&1 | sed '/^$/,$d' >"$actual" check "$expected" "$actual" @@ -841,5 +841,43 @@ END:VCALENDAR" | TZ=UTC mhical >"$actual" check "$expected" "$actual" +# check invalid line folding +start_test "invalid line folding" + +cat >"$expected" <<'EOF' +Summary: test +Description: this file does not end with a newline +At: Sun, 14 May 2017 13:00 +0000 +To: Sun, 14 May 2017 14:00 +EOF + +cat >"$expected_err" <<'EOF' +mhical: syntax error, unexpected ICAL_COMMA, expecting ICAL_COLON after " this line is not folded" +EOF + +set +e +printf %s \ +"BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//TDP v3.0//EN +BEGIN:VEVENT +DTSTAMP:20170514T122300Z +DTSTART:20170514T130000Z +DTEND:20170514T140000Z +SUMMARY:test +DESCRIPTION:this file does not end with a newline +and this line is not folded, +END:VEVENT +END:VCALENDAR" | TZ=UTC mhical >"$actual" 2>"$actual_err" +set -e +check "$expected" "$actual" +check "$expected_err" "$actual_err" + + +# check null input +start_test "null input" +check_exit '-eq 0' mhical