From 6e64b175aa51ec411c5d013e91caf53dad4877cf Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Wed, 21 Aug 2024 12:44:01 -0400 Subject: [PATCH] Diagnose lines that are implicitly treated as REM lines. Diagnose REM commands that are implicitly treated as having MSG type. Properly start all lines that should start with REM, with REM. --- include/holidays/gr.rem | 2 +- include/holidays/jewish.rem | 70 ++++++++++++++-------------- src/calendar.c | 4 +- src/dorem.c | 1 + src/main.c | 10 +++- tests/queue1.rem | 2 +- tests/shade.rem | 8 ++-- tests/test.cmp | 91 ++++++++++++++++++------------------- tests/test.rem | 72 ++++++++++++++--------------- tests/utf-8.rem | 6 +-- 10 files changed, 136 insertions(+), 130 deletions(-) diff --git a/include/holidays/gr.rem b/include/holidays/gr.rem index 3e059e8c..fdedf088 100644 --- a/include/holidays/gr.rem +++ b/include/holidays/gr.rem @@ -10,7 +10,7 @@ REM 28 Oct MSG ΟΧΙ REM 25 Dec MSG ΧΡΙΣΤΟΥΓΕΝΝΑ REM 26 Dec MSG ΧΡΙΣΤΟΥΓΕΝΝΑ2 -REM [orthodoxeaster($Uy)+1] ΔΕΥΤΕΡΑ ΤΟΥ ΠΑΣΧΑ +REM [orthodoxeaster($Uy)+1] MSG ΔΕΥΤΕΡΑ ΤΟΥ ΠΑΣΧΑ # May first is a national holiday except if Sunday, day of great week (week before easter) or Monday after easter, then diff --git a/include/holidays/jewish.rem b/include/holidays/jewish.rem index d81c337a..a0246125 100644 --- a/include/holidays/jewish.rem +++ b/include/holidays/jewish.rem @@ -19,50 +19,50 @@ FSET _BackTwoSat(x, y) IIF(WKDAYNUM(_h2(x,y))!=6, _h2(x,y), _h2(x,y)-2) SET InIsrael VALUE("InIsrael", 0) SET Reform VALUE("Reform", 0) -[_h(1, "Tishrey")] ++4 MSG %"Rosh Hashana 1%" is %b. +REM [_h(1, "Tishrey")] ++4 MSG %"Rosh Hashana 1%" is %b. # No RH-2 or Tzom Gedalia in Reform IF !Reform - [_h(2, "Tishrey")] ++4 MSG %"Rosh Hashana 2%" is %b. - [_PastSat(3, "Tishrey")] ++4 MSG %"Tzom Gedalia%" is %b. + REM [_h(2, "Tishrey")] ++4 MSG %"Rosh Hashana 2%" is %b. + REM [_PastSat(3, "Tishrey")] ++4 MSG %"Tzom Gedalia%" is %b. ENDIF -[_h(10, "Tishrey")] ++4 MSG %"Yom Kippur%" is %b. -[_h(15, "Tishrey")] ++4 MSG %"Sukkot 1%" is %b. +REM [_h(10, "Tishrey")] ++4 MSG %"Yom Kippur%" is %b. +REM [_h(15, "Tishrey")] ++4 MSG %"Sukkot 1%" is %b. IF !InIsrael - [_h(16, "Tishrey")] MSG %"Sukkot 2%" + REM [_h(16, "Tishrey")] MSG %"Sukkot 2%" ENDIF -[_h(21, "Tishrey")] ++4 MSG %"Hoshana Rabba%" is %b. -[_h(22, "Tishrey")] ++4 MSG %"Shemini Atzeret%" is %b. +REM [_h(21, "Tishrey")] ++4 MSG %"Hoshana Rabba%" is %b. +REM [_h(22, "Tishrey")] ++4 MSG %"Shemini Atzeret%" is %b. IF InIsrael - [_h(22, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b. + REM [_h(22, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b. ELSE - [_h(23, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b. + REM [_h(23, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b. ENDIF # Because Kislev can change length, we must be more careful about Chanukah FSET _chan(x) HEBDATE(24, "Kislev", $U-9)+x -[_chan(1)] ++4 MSG %"Chanukah 1%" is %b. -[_chan(2)] MSG %"Chanukah 2%" -[_chan(3)] MSG %"Chanukah 3%" -[_chan(4)] MSG %"Chanukah 4%" -[_chan(5)] MSG %"Chanukah 5%" -[_chan(6)] MSG %"Chanukah 6%" -[_chan(7)] MSG %"Chanukah 7%" -[_chan(8)] MSG %"Chanukah 8%" +REM [_chan(1)] ++4 MSG %"Chanukah 1%" is %b. +REM [_chan(2)] MSG %"Chanukah 2%" +REM [_chan(3)] MSG %"Chanukah 3%" +REM [_chan(4)] MSG %"Chanukah 4%" +REM [_chan(5)] MSG %"Chanukah 5%" +REM [_chan(6)] MSG %"Chanukah 6%" +REM [_chan(7)] MSG %"Chanukah 7%" +REM [_chan(8)] MSG %"Chanukah 8%" # Not sure about Reform's position on the next one. IF !Reform # 10 Tevet will never be a Saturday, so whether or not to # move it is moot. (Thanks to Art Werschulz.) - [_h(10, "Tevet")] MSG %"Tzom Tevet%" is %b. + REM [_h(10, "Tevet")] MSG %"Tzom Tevet%" is %b. ENDIF -[_h(15, "Shvat")] ++4 MSG %"Tu B'Shvat%" is %b. -[_h(14, "Adar A")] ++4 MSG %"Purim Katan%" is %b. +REM [_h(15, "Shvat")] ++4 MSG %"Tu B'Shvat%" is %b. +REM [_h(14, "Adar A")] ++4 MSG %"Purim Katan%" is %b. # If Purim is on Sunday, then Fast of Esther is 11 Adar. IF WKDAYNUM(_h2(13, "Adar")) != 6 @@ -70,39 +70,39 @@ IF WKDAYNUM(_h2(13, "Adar")) != 6 ELSE REM [_h2(11, "Adar")] ++4 MSG %"Fast of Esther%" is %b. ENDIF -[_h(14, "Adar")] ++4 MSG %"Purim%" is %b. -[_h(15, "Nisan")] ++4 MSG %"Pesach%" is %b. +REM [_h(14, "Adar")] ++4 MSG %"Purim%" is %b. +REM [_h(15, "Nisan")] ++4 MSG %"Pesach%" is %b. IF !InIsrael - [_h(16, "Nisan")] MSG %"Pesach 2%" + REM [_h(16, "Nisan")] MSG %"Pesach 2%" ENDIF -[_h(21, "Nisan")] MSG %"Pesach 7%" +REM [_h(21, "Nisan")] MSG %"Pesach 7%" IF !InIsrael && !Reform - [_h(22, "Nisan")] MSG %"Pesach 8%" + REM [_h(22, "Nisan")] MSG %"Pesach 8%" ENDIF -[_h(27, "Nisan")] ++4 MSG %"Yom HaShoah%" is %b. -[_BackTwoFri(4, "Iyar")] ++4 MSG %"Yom HaZikaron%" is %b. -[_BackTwoSat(5, "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b. +REM [_h(27, "Nisan")] ++4 MSG %"Yom HaShoah%" is %b. +REM [_BackTwoFri(4, "Iyar")] ++4 MSG %"Yom HaZikaron%" is %b. +REM [_BackTwoSat(5, "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b. # Not sure about Reform's position on Lag B'Omer IF !Reform - [_h(18, "Iyar")] ++4 MSG %"Lag B'Omer%" is %b. + REM [_h(18, "Iyar")] ++4 MSG %"Lag B'Omer%" is %b. ENDIF -[_h(28, "Iyar")] ++4 MSG %"Yom Yerushalayim%" is %b. -[_h(6, "Sivan")] ++4 MSG %"Shavuot%" is %b. +REM [_h(28, "Iyar")] ++4 MSG %"Yom Yerushalayim%" is %b. +REM [_h(6, "Sivan")] ++4 MSG %"Shavuot%" is %b. IF !InIsrael && !Reform - [_h(7, "Sivan")] MSG %"Shavuot 2%" + REM [_h(7, "Sivan")] MSG %"Shavuot 2%" ENDIF # Fairly sure Reform Jews don't observe the next two IF !Reform # Tzom Tamuz and Tish'a B'Av are moved to Sunday if they normally # fall on a Saturday - [_PastSat(17, "Tamuz")] ++4 MSG %"Tzom Tammuz%" is %b. - [_PastSat(9, "Av")] ++4 MSG %"Tish'a B'Av%" is %b. + REM [_PastSat(17, "Tamuz")] ++4 MSG %"Tzom Tammuz%" is %b. + REM [_PastSat(9, "Av")] ++4 MSG %"Tish'a B'Av%" is %b. ENDIF diff --git a/src/calendar.c b/src/calendar.c index 69a1f8f0..811ba24c 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -1683,7 +1683,9 @@ static void GenerateCalEntries(int col) /* Note: Since the parser hasn't been used yet, we don't */ /* need to destroy it here. */ - default: CreateParser(CurLine, &p); + default: + Wprint("Unrecognized command; interpreting as REM MSG ..."); + CreateParser(CurLine, &p); r=DoCalRem(&p, col); break; } diff --git a/src/dorem.c b/src/dorem.c index 84a19949..626e5bca 100644 --- a/src/dorem.c +++ b/src/dorem.c @@ -540,6 +540,7 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim) DBufFree(&buf); trig->typ = MSG_TYPE; if (s->isnested) return E_CANT_NEST_RTYPE; + Wprint("Missing REM type; assuming MSG"); parsing = 0; break; } diff --git a/src/main.c b/src/main.c index 9b7d3143..65665b6b 100644 --- a/src/main.c +++ b/src/main.c @@ -353,9 +353,15 @@ static void DoReminders(void) break; - /* If we don't recognize the command, do a REM by default */ + /* If we don't recognize the command, do a REM by default, but warn */ - default: DestroyParser(&p); CreateParser(CurLine, &p); purge_handled = 1; r=DoRem(&p); break; + default: + Wprint("Unrecognized command; interpreting as REM MSG ..."); + DestroyParser(&p); + CreateParser(CurLine, &p); + purge_handled = 1; + r=DoRem(&p); + break; } if (r && (!Hush || r != E_RUN_DISABLED)) { diff --git a/tests/queue1.rem b/tests/queue1.rem index 436af832..71242623 100644 --- a/tests/queue1.rem +++ b/tests/queue1.rem @@ -2,5 +2,5 @@ FSET msgprefix(x) "Priority: " + x + "; Filename: " + filename() + ": " REM at 23:56 MSG foo REM PRIORITY 42 at 23:57 MSG bar -REM PRIORITY 999 at 23:58 MSQ quux +REM PRIORITY 999 at 23:58 MSG quux DO queue2.rem diff --git a/tests/shade.rem b/tests/shade.rem index 4673866f..c0b768bd 100644 --- a/tests/shade.rem +++ b/tests/shade.rem @@ -9,10 +9,10 @@ set $LatMin 24 set $LatSec 0 IF $PSCAL - [trigger(moondate(0))] SPECIAL MOON 0 -1 -1 [moontime(0)] - [trigger(moondate(1))] SPECIAL MOON 1 -1 -1 [moontime(1)] - [trigger(moondate(2))] SPECIAL MOON 2 -1 -1 [moontime(2)] - [trigger(moondate(3))] SPECIAL MOON 3 -1 -1 [moontime(3)] + REM [trigger(moondate(0))] SPECIAL MOON 0 -1 -1 [moontime(0)] + REM [trigger(moondate(1))] SPECIAL MOON 1 -1 -1 [moontime(1)] + REM [trigger(moondate(2))] SPECIAL MOON 2 -1 -1 [moontime(2)] + REM [trigger(moondate(3))] SPECIAL MOON 3 -1 -1 [moontime(3)] ENDIF REM 4 PS (First-Bit-Of-PS) diff --git a/tests/test.cmp b/tests/test.cmp index 9be047a8..9e7abdfb 100644 --- a/tests/test.cmp +++ b/tests/test.cmp @@ -97,18 +97,18 @@ fset _h(x, y) trigger(hebdate(x,y)) # Test case from Remind mailing list set mltest "a b" -INCLUDECMD printf 'REM %s\n' [mltest] +INCLUDECMD printf 'REM MSG %s\n' [mltest] mltest => "a b" -REM a -REM b +REM MSG a +REM MSG b -REM a -printf 'REM %s\n' a b|(1): Trig = Saturday, 16 February, 1991 -a +REM MSG a +printf 'REM MSG %s\n' a b|(1): Trig = Saturday, 16 February, 1991 +a -REM b -printf 'REM %s\n' a b|(2): Trig = Saturday, 16 February, 1991 -b +REM MSG b +printf 'REM MSG %s\n' a b|(2): Trig = Saturday, 16 February, 1991 +b # Disabling RUN in an !includecmd @@ -156,7 +156,7 @@ echo MSG foo|(1): Trig = Saturday, 16 February, 1991 foo -[_h(1, "Tishrey")] MSG Rosh Hashana 1 +REM [_h(1, "Tishrey")] MSG Rosh Hashana 1 Entering UserFN _h(1, "Tishrey") x => 1 y => "Tishrey" @@ -164,7 +164,7 @@ hebdate(1, "Tishrey") => 1991-09-09 trigger(1991-09-09) => "9 September 1991" Leaving UserFN _h(1, "Tishrey") => "9 September 1991" ../tests/test.rem(52): Trig = Monday, 9 September, 1991 -[_h(2, "Tishrey")] MSG Rosh Hashana 2 +REM [_h(2, "Tishrey")] MSG Rosh Hashana 2 Entering UserFN _h(2, "Tishrey") x => 2 y => "Tishrey" @@ -172,7 +172,7 @@ hebdate(2, "Tishrey") => 1991-09-10 trigger(1991-09-10) => "10 September 1991" Leaving UserFN _h(2, "Tishrey") => "10 September 1991" ../tests/test.rem(53): Trig = Tuesday, 10 September, 1991 -[_h(3, "Tishrey")] MSG Tzom Gedalia +REM [_h(3, "Tishrey")] MSG Tzom Gedalia Entering UserFN _h(3, "Tishrey") x => 3 y => "Tishrey" @@ -180,7 +180,7 @@ hebdate(3, "Tishrey") => 1991-09-11 trigger(1991-09-11) => "11 September 1991" Leaving UserFN _h(3, "Tishrey") => "11 September 1991" ../tests/test.rem(54): Trig = Wednesday, 11 September, 1991 -[_h(10, "Tishrey")] MSG Yom Kippur +REM [_h(10, "Tishrey")] MSG Yom Kippur Entering UserFN _h(10, "Tishrey") x => 10 y => "Tishrey" @@ -188,7 +188,7 @@ hebdate(10, "Tishrey") => 1991-09-18 trigger(1991-09-18) => "18 September 1991" Leaving UserFN _h(10, "Tishrey") => "18 September 1991" ../tests/test.rem(55): Trig = Wednesday, 18 September, 1991 -[_h(15, "Tishrey")] MSG Sukkot 1 +REM [_h(15, "Tishrey")] MSG Sukkot 1 Entering UserFN _h(15, "Tishrey") x => 15 y => "Tishrey" @@ -196,7 +196,7 @@ hebdate(15, "Tishrey") => 1991-09-23 trigger(1991-09-23) => "23 September 1991" Leaving UserFN _h(15, "Tishrey") => "23 September 1991" ../tests/test.rem(56): Trig = Monday, 23 September, 1991 -[_h(25, "Kislev")] MSG Channuka +REM [_h(25, "Kislev")] MSG Channuka Entering UserFN _h(25, "Kislev") x => 25 y => "Kislev" @@ -204,7 +204,7 @@ hebdate(25, "Kislev") => 1991-12-02 trigger(1991-12-02) => "2 December 1991" Leaving UserFN _h(25, "Kislev") => "2 December 1991" ../tests/test.rem(57): Trig = Monday, 2 December, 1991 -[_h(10, "Tevet")] MSG Asara B'Tevet +REM [_h(10, "Tevet")] MSG Asara B'Tevet Entering UserFN _h(10, "Tevet") x => 10 y => "Tevet" @@ -212,7 +212,7 @@ hebdate(10, "Tevet") => 1991-12-17 trigger(1991-12-17) => "17 December 1991" Leaving UserFN _h(10, "Tevet") => "17 December 1991" ../tests/test.rem(58): Trig = Tuesday, 17 December, 1991 -[_h(15, "Shvat")] MSG Tu B'Shvat +REM [_h(15, "Shvat")] MSG Tu B'Shvat Entering UserFN _h(15, "Shvat") x => 15 y => "Shvat" @@ -220,7 +220,7 @@ hebdate(15, "Shvat") => 1992-01-20 trigger(1992-01-20) => "20 January 1992" Leaving UserFN _h(15, "Shvat") => "20 January 1992" ../tests/test.rem(59): Trig = Monday, 20 January, 1992 -[_h(15, "Adar A")] MSG Purim Katan +REM [_h(15, "Adar A")] MSG Purim Katan Entering UserFN _h(15, "Adar A") x => 15 y => "Adar A" @@ -228,7 +228,7 @@ hebdate(15, "Adar A") => 1992-02-19 trigger(1992-02-19) => "19 February 1992" Leaving UserFN _h(15, "Adar A") => "19 February 1992" ../tests/test.rem(60): Trig = Wednesday, 19 February, 1992 -[_h(14, "Adar")] MSG Purim +REM [_h(14, "Adar")] MSG Purim Entering UserFN _h(14, "Adar") x => 14 y => "Adar" @@ -236,7 +236,7 @@ hebdate(14, "Adar") => 1991-02-28 trigger(1991-02-28) => "28 February 1991" Leaving UserFN _h(14, "Adar") => "28 February 1991" ../tests/test.rem(61): Trig = Thursday, 28 February, 1991 -[_h(15, "Nisan")] MSG Pesach +REM [_h(15, "Nisan")] MSG Pesach Entering UserFN _h(15, "Nisan") x => 15 y => "Nisan" @@ -244,7 +244,7 @@ hebdate(15, "Nisan") => 1991-03-30 trigger(1991-03-30) => "30 March 1991" Leaving UserFN _h(15, "Nisan") => "30 March 1991" ../tests/test.rem(62): Trig = Saturday, 30 March, 1991 -[_h(27, "Nisan")] MSG Yom HaShoah +REM [_h(27, "Nisan")] MSG Yom HaShoah Entering UserFN _h(27, "Nisan") x => 27 y => "Nisan" @@ -252,7 +252,7 @@ hebdate(27, "Nisan") => 1991-04-11 trigger(1991-04-11) => "11 April 1991" Leaving UserFN _h(27, "Nisan") => "11 April 1991" ../tests/test.rem(63): Trig = Thursday, 11 April, 1991 -[_h(4, "Iyar")] MSG Yom HaZikaron +REM [_h(4, "Iyar")] MSG Yom HaZikaron Entering UserFN _h(4, "Iyar") x => 4 y => "Iyar" @@ -260,7 +260,7 @@ hebdate(4, "Iyar") => 1991-04-18 trigger(1991-04-18) => "18 April 1991" Leaving UserFN _h(4, "Iyar") => "18 April 1991" ../tests/test.rem(64): Trig = Thursday, 18 April, 1991 -[_h(5, "Iyar")] MSG Yom Ha'atzmaut +REM [_h(5, "Iyar")] MSG Yom Ha'atzmaut Entering UserFN _h(5, "Iyar") x => 5 y => "Iyar" @@ -268,7 +268,7 @@ hebdate(5, "Iyar") => 1991-04-19 trigger(1991-04-19) => "19 April 1991" Leaving UserFN _h(5, "Iyar") => "19 April 1991" ../tests/test.rem(65): Trig = Friday, 19 April, 1991 -[_h(28, "Iyar")] MSG Yom Yerushalayim +REM [_h(28, "Iyar")] MSG Yom Yerushalayim Entering UserFN _h(28, "Iyar") x => 28 y => "Iyar" @@ -276,7 +276,7 @@ hebdate(28, "Iyar") => 1991-05-12 trigger(1991-05-12) => "12 May 1991" Leaving UserFN _h(28, "Iyar") => "12 May 1991" ../tests/test.rem(66): Trig = Sunday, 12 May, 1991 -[_h(6, "Sivan")] MSG Shavuot +REM [_h(6, "Sivan")] MSG Shavuot Entering UserFN _h(6, "Sivan") x => 6 y => "Sivan" @@ -284,7 +284,7 @@ hebdate(6, "Sivan") => 1991-05-19 trigger(1991-05-19) => "19 May 1991" Leaving UserFN _h(6, "Sivan") => "19 May 1991" ../tests/test.rem(67): Trig = Sunday, 19 May, 1991 -[_h(9, "Av")] MSG Tish'a B'Av +REM [_h(9, "Av")] MSG Tish'a B'Av Entering UserFN _h(9, "Av") x => 9 y => "Av" @@ -295,7 +295,7 @@ Leaving UserFN _h(9, "Av") => "20 July 1991" # Test some jahrzeit cases fset _i(x,y,z,a) trigger(hebdate(x,y,z,a)) -[_i(30, "Heshvan", today(), 5759)] MSG Complete-Complete +REM [_i(30, "Heshvan", today(), 5759)] MSG Complete-Complete today() => 1991-02-16 Entering UserFN _i(30, "Heshvan", 1991-02-16, 5759) x => 30 @@ -306,7 +306,7 @@ hebdate(30, "Heshvan", 1991-02-16, 5759) => 1991-11-07 trigger(1991-11-07) => "7 November 1991" Leaving UserFN _i(30, "Heshvan", 1991-02-16, 5759) => "7 November 1991" ../tests/test.rem(72): Trig = Thursday, 7 November, 1991 -[_i(30, "Heshvan", today(), 5760)] MSG Complete-Defective +REM [_i(30, "Heshvan", today(), 5760)] MSG Complete-Defective today() => 1991-02-16 Entering UserFN _i(30, "Heshvan", 1991-02-16, 5760) x => 30 @@ -317,7 +317,7 @@ hebdate(30, "Heshvan", 1991-02-16, 5760) => 1991-11-07 trigger(1991-11-07) => "7 November 1991" Leaving UserFN _i(30, "Heshvan", 1991-02-16, 5760) => "7 November 1991" ../tests/test.rem(73): Trig = Thursday, 7 November, 1991 -[_i(30, "Heshvan", today(), 5761)] MSG Illegal +REM [_i(30, "Heshvan", today(), 5761)] MSG Illegal today() => 1991-02-16 Entering UserFN _i(30, "Heshvan", 1991-02-16, 5761) x => 30 @@ -329,7 +329,7 @@ hebdate(30, "Heshvan", 1991-02-16, 5761) => ../tests/test.rem(74): 30 Heshvan 57 Invalid Hebrew date Leaving UserFN _i(30, "Heshvan", 1991-02-16, 5761) => Invalid Hebrew date -[_i(30, "Kislev", today(), 5759)] MSG Complete-Complete +REM [_i(30, "Kislev", today(), 5759)] MSG Complete-Complete today() => 1991-02-16 Entering UserFN _i(30, "Kislev", 1991-02-16, 5759) x => 30 @@ -340,7 +340,7 @@ hebdate(30, "Kislev", 1991-02-16, 5759) => 1991-12-07 trigger(1991-12-07) => "7 December 1991" Leaving UserFN _i(30, "Kislev", 1991-02-16, 5759) => "7 December 1991" ../tests/test.rem(76): Trig = Saturday, 7 December, 1991 -[_i(30, "Kislev", today(), 5760)] MSG Complete-Defective +REM [_i(30, "Kislev", today(), 5760)] MSG Complete-Defective today() => 1991-02-16 Entering UserFN _i(30, "Kislev", 1991-02-16, 5760) x => 30 @@ -351,7 +351,7 @@ hebdate(30, "Kislev", 1991-02-16, 5760) => 1991-12-07 trigger(1991-12-07) => "7 December 1991" Leaving UserFN _i(30, "Kislev", 1991-02-16, 5760) => "7 December 1991" ../tests/test.rem(77): Trig = Saturday, 7 December, 1991 -[_i(30, "Kislev", today(), 5761)] MSG Illegal +REM [_i(30, "Kislev", today(), 5761)] MSG Illegal today() => 1991-02-16 Entering UserFN _i(30, "Kislev", 1991-02-16, 5761) x => 30 @@ -363,7 +363,7 @@ hebdate(30, "Kislev", 1991-02-16, 5761) => ../tests/test.rem(78): 30 Kislev 5761 Invalid Hebrew date Leaving UserFN _i(30, "Kislev", 1991-02-16, 5761) => Invalid Hebrew date -[_i(30, "Adar A", today(), 5755)] MSG Leap +REM [_i(30, "Adar A", today(), 5755)] MSG Leap today() => 1991-02-16 Entering UserFN _i(30, "Adar A", 1991-02-16, 5755) x => 30 @@ -374,7 +374,7 @@ hebdate(30, "Adar A", 1991-02-16, 5755) => 1992-03-05 trigger(1992-03-05) => "5 March 1992" Leaving UserFN _i(30, "Adar A", 1991-02-16, 5755) => "5 March 1992" ../tests/test.rem(80): Trig = Thursday, 5 March, 1992 -[_i(30, "Adar A", today(), 5756)] MSG Illegal +REM [_i(30, "Adar A", today(), 5756)] MSG Illegal today() => 1991-02-16 Entering UserFN _i(30, "Adar A", 1991-02-16, 5756) x => 30 @@ -385,7 +385,7 @@ hebdate(30, "Adar A", 1991-02-16, 5756) => ../tests/test.rem(81): No Adar A in 5 ../tests/test.rem(71): [#0] In function `_i' Invalid Hebrew date Leaving UserFN _i(30, "Adar A", 1991-02-16, 5756) => Invalid Hebrew date -[_i(29, "Adar A", today(), 5755)] MSG Leap +REM [_i(29, "Adar A", today(), 5755)] MSG Leap today() => 1991-02-16 Entering UserFN _i(29, "Adar A", 1991-02-16, 5755) x => 29 @@ -396,7 +396,7 @@ hebdate(29, "Adar A", 1991-02-16, 5755) => 1991-03-15 trigger(1991-03-15) => "15 March 1991" Leaving UserFN _i(29, "Adar A", 1991-02-16, 5755) => "15 March 1991" ../tests/test.rem(82): Trig = Friday, 15 March, 1991 -[_i(29, "Adar A", today(), 5756)] MSG Illegal +REM [_i(29, "Adar A", today(), 5756)] MSG Illegal today() => 1991-02-16 Entering UserFN _i(29, "Adar A", 1991-02-16, 5756) x => 29 @@ -816,12 +816,12 @@ REM MSG The tags are: [trigtags()] trigtags() => "" The tags are: -REM TAG foo The tags are: [trigtags()] +REM TAG foo MSG The tags are: [trigtags()] ../tests/test.rem(241): Trig = Saturday, 16 February, 1991 trigtags() => "foo" The tags are: foo -REM TAG foo TAG bar TAG quux TAG znort TAG cabbage The tags are: [trigtags()] +REM TAG foo TAG bar TAG quux TAG znort TAG cabbage MSG The tags are: [trigtags()] ../tests/test.rem(242): Trig = Saturday, 16 February, 1991 trigtags() => "foo,bar,quux,znort,cabbage" The tags are: foo,bar,quux,znort,cabbage @@ -3134,17 +3134,17 @@ REM [x] *1 UNTIL 1991-12-31 MSG Not diagnosed - nonconst expression x => 1992-01-01 ../tests/test.rem(560): Trig = Wednesday, 1 January, 1992 -REM MON FROM 1992-01-01 UNTIL 1991-12-31 Diagnosed +REM MON FROM 1992-01-01 UNTIL 1991-12-31 MSG Diagnosed ../tests/test.rem(562): Warning: UNTIL/THROUGH date earlier than FROM date ../tests/test.rem(562): Expired -REM MON SCANFROM 1992-01-01 UNTIL 1991-12-31 Diagnosed +REM MON SCANFROM 1992-01-01 UNTIL 1991-12-31 MSG Diagnosed ../tests/test.rem(563): Warning: UNTIL/THROUGH date earlier than SCANFROM date ../tests/test.rem(563): Expired -REM MON FROM [x] UNTIL 1991-12-31 Not diagnosed +REM MON FROM [x] UNTIL 1991-12-31 MSG Not diagnosed x => 1992-01-01 ../tests/test.rem(565): Expired -REM MON SCANFROM [x] UNTIL 1991-12-31 Not diagnosed +REM MON SCANFROM [x] UNTIL 1991-12-31 MSG Not diagnosed x => 1992-01-01 ../tests/test.rem(566): Expired @@ -3189,7 +3189,7 @@ Global Partial OMITs (1 of maximum allowed 366): Global Weekday OMITs: None. # Regression test for bugfix in Hebrew calendar Adar jahrzeit -[_i(14, "Adar", today(), 5761)] MSG Purim +REM [_i(14, "Adar", today(), 5761)] MSG Purim today() => 1991-02-16 Entering UserFN _i(14, "Adar", 1991-02-16, 5761) x => 14 @@ -3854,10 +3854,7 @@ ENDIF # Trig with a good warnfunc FSET w(x) choose(x, 5, 3, 1, 0) -Short-circuit operators -../tests/test.rem(780): Trig = Saturday, 16 February, 1991 -Short-circuit operators - +# Short-circuit operators IF trig("sun warn w") || trig("thu warn w") trig("sun warn w") => ../tests/test.rem(781): Trig = Sunday, 17 February, 1991 Entering UserFN w(1) diff --git a/tests/test.rem b/tests/test.rem index cb6c62c9..3bb7301d 100644 --- a/tests/test.rem +++ b/tests/test.rem @@ -33,7 +33,7 @@ fset _h(x, y) trigger(hebdate(x,y)) # Test case from Remind mailing list set mltest "a b" -INCLUDECMD printf 'REM %s\n' [mltest] +INCLUDECMD printf 'REM MSG %s\n' [mltest] # Disabling RUN in an !includecmd INCLUDECMD !echo MSG foo @@ -49,38 +49,38 @@ INCLUDECMD echo MSG foo RUN ON INCLUDECMD echo MSG foo -[_h(1, "Tishrey")] MSG Rosh Hashana 1 -[_h(2, "Tishrey")] MSG Rosh Hashana 2 -[_h(3, "Tishrey")] MSG Tzom Gedalia -[_h(10, "Tishrey")] MSG Yom Kippur -[_h(15, "Tishrey")] MSG Sukkot 1 -[_h(25, "Kislev")] MSG Channuka -[_h(10, "Tevet")] MSG Asara B'Tevet -[_h(15, "Shvat")] MSG Tu B'Shvat -[_h(15, "Adar A")] MSG Purim Katan -[_h(14, "Adar")] MSG Purim -[_h(15, "Nisan")] MSG Pesach -[_h(27, "Nisan")] MSG Yom HaShoah -[_h(4, "Iyar")] MSG Yom HaZikaron -[_h(5, "Iyar")] MSG Yom Ha'atzmaut -[_h(28, "Iyar")] MSG Yom Yerushalayim -[_h(6, "Sivan")] MSG Shavuot -[_h(9, "Av")] MSG Tish'a B'Av +REM [_h(1, "Tishrey")] MSG Rosh Hashana 1 +REM [_h(2, "Tishrey")] MSG Rosh Hashana 2 +REM [_h(3, "Tishrey")] MSG Tzom Gedalia +REM [_h(10, "Tishrey")] MSG Yom Kippur +REM [_h(15, "Tishrey")] MSG Sukkot 1 +REM [_h(25, "Kislev")] MSG Channuka +REM [_h(10, "Tevet")] MSG Asara B'Tevet +REM [_h(15, "Shvat")] MSG Tu B'Shvat +REM [_h(15, "Adar A")] MSG Purim Katan +REM [_h(14, "Adar")] MSG Purim +REM [_h(15, "Nisan")] MSG Pesach +REM [_h(27, "Nisan")] MSG Yom HaShoah +REM [_h(4, "Iyar")] MSG Yom HaZikaron +REM [_h(5, "Iyar")] MSG Yom Ha'atzmaut +REM [_h(28, "Iyar")] MSG Yom Yerushalayim +REM [_h(6, "Sivan")] MSG Shavuot +REM [_h(9, "Av")] MSG Tish'a B'Av # Test some jahrzeit cases fset _i(x,y,z,a) trigger(hebdate(x,y,z,a)) -[_i(30, "Heshvan", today(), 5759)] MSG Complete-Complete -[_i(30, "Heshvan", today(), 5760)] MSG Complete-Defective -[_i(30, "Heshvan", today(), 5761)] MSG Illegal +REM [_i(30, "Heshvan", today(), 5759)] MSG Complete-Complete +REM [_i(30, "Heshvan", today(), 5760)] MSG Complete-Defective +REM [_i(30, "Heshvan", today(), 5761)] MSG Illegal -[_i(30, "Kislev", today(), 5759)] MSG Complete-Complete -[_i(30, "Kislev", today(), 5760)] MSG Complete-Defective -[_i(30, "Kislev", today(), 5761)] MSG Illegal +REM [_i(30, "Kislev", today(), 5759)] MSG Complete-Complete +REM [_i(30, "Kislev", today(), 5760)] MSG Complete-Defective +REM [_i(30, "Kislev", today(), 5761)] MSG Illegal -[_i(30, "Adar A", today(), 5755)] MSG Leap -[_i(30, "Adar A", today(), 5756)] MSG Illegal -[_i(29, "Adar A", today(), 5755)] MSG Leap -[_i(29, "Adar A", today(), 5756)] MSG Illegal +REM [_i(30, "Adar A", today(), 5755)] MSG Leap +REM [_i(30, "Adar A", today(), 5756)] MSG Illegal +REM [_i(29, "Adar A", today(), 5755)] MSG Leap +REM [_i(29, "Adar A", today(), 5756)] MSG Illegal # This causes a parse error on version 03.01.01 REM 1990-01-01 SATISFY 1 @@ -238,8 +238,8 @@ CLEAR-OMIT-CONTEXT REM tag ill,egal MSG bad tag REM MSG The tags are: [trigtags()] -REM TAG foo The tags are: [trigtags()] -REM TAG foo TAG bar TAG quux TAG znort TAG cabbage The tags are: [trigtags()] +REM TAG foo MSG The tags are: [trigtags()] +REM TAG foo TAG bar TAG quux TAG znort TAG cabbage MSG The tags are: [trigtags()] REM MSG The tags are: [trigtags()] # Test ADDOMIT @@ -559,11 +559,11 @@ REM 1992-01-01 *1 UNTIL 1991-12-31 MSG Diagnosed set x '1992-01-01' REM [x] *1 UNTIL 1991-12-31 MSG Not diagnosed - nonconst expression -REM MON FROM 1992-01-01 UNTIL 1991-12-31 Diagnosed -REM MON SCANFROM 1992-01-01 UNTIL 1991-12-31 Diagnosed +REM MON FROM 1992-01-01 UNTIL 1991-12-31 MSG Diagnosed +REM MON SCANFROM 1992-01-01 UNTIL 1991-12-31 MSG Diagnosed -REM MON FROM [x] UNTIL 1991-12-31 Not diagnosed -REM MON SCANFROM [x] UNTIL 1991-12-31 Not diagnosed +REM MON FROM [x] UNTIL 1991-12-31 MSG Not diagnosed +REM MON SCANFROM [x] UNTIL 1991-12-31 MSG Not diagnosed REM 1992-01-01 UNTIL 1992-02-02 MSG Diagnosed REM [x] UNTIL 1992-02-02 MSG Diagnosed @@ -575,7 +575,7 @@ OMIT December 25 MSG X OMIT 26 Dec 2010 THROUGH 27 Dec 2010 MSG This is not legal OMIT DUMP # Regression test for bugfix in Hebrew calendar Adar jahrzeit -[_i(14, "Adar", today(), 5761)] MSG Purim +REM [_i(14, "Adar", today(), 5761)] MSG Purim # Regression test for bug found by Larry Hynes REM SATISFY [day(trigdate()-25) == 14] MSG Foo @@ -777,7 +777,7 @@ ENDIF # Trig with a good warnfunc FSET w(x) choose(x, 5, 3, 1, 0) -Short-circuit operators +# Short-circuit operators IF trig("sun warn w") || trig("thu warn w") REM [trig()] +5 MSG Foo %b ENDIF diff --git a/tests/utf-8.rem b/tests/utf-8.rem index f8c370b9..2a208665 100644 --- a/tests/utf-8.rem +++ b/tests/utf-8.rem @@ -1,7 +1,7 @@ -MSG ру́сский ру́сский ру́сский ру́сский ру́сский ру́сский ру́сский ру́сский -MSG עִבְרִית עִבְרִית עִבְרִית עִבְרִית עִבְרִית עִבְרִית עִבְרִית עִבְרִית עִבְרִית +REM MSG ру́сский ру́сский ру́сский ру́сский ру́сский ру́сский ру́сский ру́сский +REM MSG עִבְרִית עִבְרִית עִבְרִית עִבְרִית עִבְרִית עִבְרִית עִבְרִית עִבְרִית עִבְרִית -Wed MSG With tabs and spaces +REM Wed MSG With tabs and spaces REM [moondate(0)] MSG 🌑 REM [moondate(1)] MSG 🌓 woo