diff options
| author | Ulf Jasper | 2014-11-17 21:00:24 +0100 |
|---|---|---|
| committer | Ulf Jasper | 2014-11-17 21:00:24 +0100 |
| commit | cc5519db12f554a40591ac8a7f4febe17a3bd53b (patch) | |
| tree | 27fdb0974ed8c756b17d023d497b1ce69749583a /test | |
| parent | 62243cb96f133581157f6eafa934b5b7ca4cc065 (diff) | |
| parent | 16b5f507688b32b78843620417bb2176b3131752 (diff) | |
| download | emacs-cc5519db12f554a40591ac8a7f4febe17a3bd53b.tar.gz emacs-cc5519db12f554a40591ac8a7f4febe17a3bd53b.zip | |
Merge branch 'uj-icalendar-bug#5433'
Diffstat (limited to 'test')
| -rw-r--r-- | test/ChangeLog | 8 | ||||
| -rw-r--r-- | test/automated/icalendar-tests.el | 100 |
2 files changed, 105 insertions, 3 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 47bbfb36a10..6e350cf8ec1 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,5 +1,13 @@ | |||
| 1 | 2014-11-17 Ulf Jasper <ulf.jasper@web.de> | 1 | 2014-11-17 Ulf Jasper <ulf.jasper@web.de> |
| 2 | 2 | ||
| 3 | * automated/icalendar-tests.el (icalendar-tests--test-export): New | ||
| 4 | optional parameter `alarms'. | ||
| 5 | (icalendar-export-alarms): New test for exporting icalendar | ||
| 6 | alarms. | ||
| 7 | (icalendar-tests--test-cycle): Let `icalendar-export-alarms' be nil. | ||
| 8 | |||
| 9 | 2014-11-17 Ulf Jasper <ulf.jasper@web.de> | ||
| 10 | |||
| 3 | * automated/icalendar-tests.el (icalendar-tests--test-import): | 11 | * automated/icalendar-tests.el (icalendar-tests--test-import): |
| 4 | Mention timezone in doc string. Clean up. | 12 | Mention timezone in doc string. Clean up. |
| 5 | (icalendar-real-world): Add another test case for no-dst | 13 | (icalendar-real-world): Add another test case for no-dst |
diff --git a/test/automated/icalendar-tests.el b/test/automated/icalendar-tests.el index b45806e9777..54546722c8c 100644 --- a/test/automated/icalendar-tests.el +++ b/test/automated/icalendar-tests.el | |||
| @@ -508,18 +508,20 @@ END:VEVENT | |||
| 508 | ;; ====================================================================== | 508 | ;; ====================================================================== |
| 509 | 509 | ||
| 510 | (defun icalendar-tests--test-export (input-iso input-european input-american | 510 | (defun icalendar-tests--test-export (input-iso input-european input-american |
| 511 | expected-output) | 511 | expected-output &optional alarms) |
| 512 | "Perform an export test. | 512 | "Perform an export test. |
| 513 | Argument INPUT-ISO iso style diary string. | 513 | Argument INPUT-ISO iso style diary string. |
| 514 | Argument INPUT-EUROPEAN european style diary string. | 514 | Argument INPUT-EUROPEAN european style diary string. |
| 515 | Argument INPUT-AMERICAN american style diary string. | 515 | Argument INPUT-AMERICAN american style diary string. |
| 516 | Argument EXPECTED-OUTPUT expected iCalendar result string. | 516 | Argument EXPECTED-OUTPUT expected iCalendar result string. |
| 517 | Optional argument ALARMS the value of `icalendar-export-alarms' for this test. | ||
| 517 | 518 | ||
| 518 | European style input data must use german month names. American | 519 | European style input data must use german month names. American |
| 519 | and ISO style input data must use english month names." | 520 | and ISO style input data must use english month names." |
| 520 | (let ((tz (getenv "TZ")) | 521 | (let ((tz (getenv "TZ")) |
| 521 | (calendar-date-style 'iso) | 522 | (calendar-date-style 'iso) |
| 522 | (icalendar-recurring-start-year 2000)) | 523 | (icalendar-recurring-start-year 2000) |
| 524 | (icalendar-export-alarms alarms)) | ||
| 523 | (unwind-protect | 525 | (unwind-protect |
| 524 | (progn | 526 | (progn |
| 525 | ;;; (message "Current time zone: %s" (current-time-zone)) | 527 | ;;; (message "Current time zone: %s" (current-time-zone)) |
| @@ -753,6 +755,97 @@ RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20010706 | |||
| 753 | SUMMARY:block no end time | 755 | SUMMARY:block no end time |
| 754 | ")) | 756 | ")) |
| 755 | 757 | ||
| 758 | (ert-deftest icalendar-export-alarms () | ||
| 759 | "Perform export test with different settings for exporting alarms." | ||
| 760 | ;; no alarm | ||
| 761 | (icalendar-tests--test-export | ||
| 762 | "2014 Nov 17 19:30 no alarm" | ||
| 763 | "17 Nov 2014 19:30 no alarm" | ||
| 764 | "Nov 17 2014 19:30 no alarm" | ||
| 765 | "DTSTART;VALUE=DATE-TIME:20141117T193000 | ||
| 766 | DTEND;VALUE=DATE-TIME:20141117T203000 | ||
| 767 | SUMMARY:no alarm | ||
| 768 | " | ||
| 769 | nil) | ||
| 770 | |||
| 771 | ;; 10 minutes in advance, audio | ||
| 772 | (icalendar-tests--test-export | ||
| 773 | "2014 Nov 17 19:30 audio alarm" | ||
| 774 | "17 Nov 2014 19:30 audio alarm" | ||
| 775 | "Nov 17 2014 19:30 audio alarm" | ||
| 776 | "DTSTART;VALUE=DATE-TIME:20141117T193000 | ||
| 777 | DTEND;VALUE=DATE-TIME:20141117T203000 | ||
| 778 | SUMMARY:audio alarm | ||
| 779 | BEGIN:VALARM | ||
| 780 | ACTION:AUDIO | ||
| 781 | TRIGGER:-PT10M | ||
| 782 | END:VALARM | ||
| 783 | " | ||
| 784 | '(10 ((audio)))) | ||
| 785 | |||
| 786 | ;; 20 minutes in advance, display | ||
| 787 | (icalendar-tests--test-export | ||
| 788 | "2014 Nov 17 19:30 display alarm" | ||
| 789 | "17 Nov 2014 19:30 display alarm" | ||
| 790 | "Nov 17 2014 19:30 display alarm" | ||
| 791 | "DTSTART;VALUE=DATE-TIME:20141117T193000 | ||
| 792 | DTEND;VALUE=DATE-TIME:20141117T203000 | ||
| 793 | SUMMARY:display alarm | ||
| 794 | BEGIN:VALARM | ||
| 795 | ACTION:DISPLAY | ||
| 796 | TRIGGER:-PT20M | ||
| 797 | DESCRIPTION:display alarm | ||
| 798 | END:VALARM | ||
| 799 | " | ||
| 800 | '(20 ((display)))) | ||
| 801 | |||
| 802 | ;; 66 minutes in advance, email | ||
| 803 | (icalendar-tests--test-export | ||
| 804 | "2014 Nov 17 19:30 email alarm" | ||
| 805 | "17 Nov 2014 19:30 email alarm" | ||
| 806 | "Nov 17 2014 19:30 email alarm" | ||
| 807 | "DTSTART;VALUE=DATE-TIME:20141117T193000 | ||
| 808 | DTEND;VALUE=DATE-TIME:20141117T203000 | ||
| 809 | SUMMARY:email alarm | ||
| 810 | BEGIN:VALARM | ||
| 811 | ACTION:EMAIL | ||
| 812 | TRIGGER:-PT66M | ||
| 813 | DESCRIPTION:email alarm | ||
| 814 | SUMMARY:email alarm | ||
| 815 | ATTENDEE:MAILTO:att.one@email.com | ||
| 816 | ATTENDEE:MAILTO:att.two@email.com | ||
| 817 | END:VALARM | ||
| 818 | " | ||
| 819 | '(66 ((email ("att.one@email.com" "att.two@email.com"))))) | ||
| 820 | |||
| 821 | ;; 2 minutes in advance, all alarms | ||
| 822 | (icalendar-tests--test-export | ||
| 823 | "2014 Nov 17 19:30 all alarms" | ||
| 824 | "17 Nov 2014 19:30 all alarms" | ||
| 825 | "Nov 17 2014 19:30 all alarms" | ||
| 826 | "DTSTART;VALUE=DATE-TIME:20141117T193000 | ||
| 827 | DTEND;VALUE=DATE-TIME:20141117T203000 | ||
| 828 | SUMMARY:all alarms | ||
| 829 | BEGIN:VALARM | ||
| 830 | ACTION:EMAIL | ||
| 831 | TRIGGER:-PT2M | ||
| 832 | DESCRIPTION:all alarms | ||
| 833 | SUMMARY:all alarms | ||
| 834 | ATTENDEE:MAILTO:att.one@email.com | ||
| 835 | ATTENDEE:MAILTO:att.two@email.com | ||
| 836 | END:VALARM | ||
| 837 | BEGIN:VALARM | ||
| 838 | ACTION:AUDIO | ||
| 839 | TRIGGER:-PT2M | ||
| 840 | END:VALARM | ||
| 841 | BEGIN:VALARM | ||
| 842 | ACTION:DISPLAY | ||
| 843 | TRIGGER:-PT2M | ||
| 844 | DESCRIPTION:all alarms | ||
| 845 | END:VALARM | ||
| 846 | " | ||
| 847 | '(2 ((email ("att.one@email.com" "att.two@email.com")) (audio) (display))))) | ||
| 848 | |||
| 756 | ;; ====================================================================== | 849 | ;; ====================================================================== |
| 757 | ;; Import tests | 850 | ;; Import tests |
| 758 | ;; ====================================================================== | 851 | ;; ====================================================================== |
| @@ -1285,7 +1378,8 @@ Argument INPUT icalendar event string." | |||
| 1285 | (icalendar-import-format-status "\n Status: %s") | 1378 | (icalendar-import-format-status "\n Status: %s") |
| 1286 | (icalendar-import-format-url "\n URL: %s") | 1379 | (icalendar-import-format-url "\n URL: %s") |
| 1287 | (icalendar-import-format-class "\n Class: %s") | 1380 | (icalendar-import-format-class "\n Class: %s") |
| 1288 | (icalendar-import-format-class "\n UID: %s")) | 1381 | (icalendar-import-format-class "\n UID: %s") |
| 1382 | (icalendar-export-alarms nil)) | ||
| 1289 | (dolist (calendar-date-style '(iso european american)) | 1383 | (dolist (calendar-date-style '(iso european american)) |
| 1290 | (icalendar-tests--do-test-cycle))))) | 1384 | (icalendar-tests--do-test-cycle))))) |
| 1291 | 1385 | ||