X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/c3238c0e0adb06756462fac7f3bb63758dc7b00c..e35fb433:/test/mhical/test-mhical?ds=sidebyside diff --git a/test/mhical/test-mhical b/test/mhical/test-mhical index 44983829..ad51b09c 100755 --- a/test/mhical/test-mhical +++ b/test/mhical/test-mhical @@ -822,8 +822,8 @@ start_test "missing final newline" cat >"$expected" <<'EOF' Summary: test Description: this file does not end with a newline -At: Sun, 14 May 2017 09:00 -0400 -To: Sun, 14 May 2017 10:00 +At: Sun, 14 May 2017 13:00 +0000 +To: Sun, 14 May 2017 14:00 EOF printf %s \ @@ -837,9 +837,47 @@ DTEND:20170514T140000Z SUMMARY:test DESCRIPTION:this file does not end with a newline END:VEVENT -END:VCALENDAR" | mhical >"$actual" +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