~ubuntu-branches/ubuntu/karmic/remind/karmic

« back to all changes in this revision

Viewing changes to tests/test2.cmp

  • Committer: Bazaar Package Importer
  • Author(s): Javier Fernandez-Sanguino Pen~a
  • Date: 1999-02-19 13:36:15 UTC
  • Revision ID: james.westby@ubuntu.com-19990219133615-ovob95sord67b0ks
Tags: 03.00.22-1
* NMU upload, maintainer seems to be missing.
* Changed to main (now GPL) (Closes: #42402)
* New upstream version (Closes: #59447)
* Moved to use debconf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Test file for REMIND
 
2
#
 
3
# $Id: test2.cmp,v 1.2 1998/03/01 20:44:21 dfs Exp $
 
4
#
 
5
# Use this file to test the date calculation routines
 
6
# of the REMIND program by typing:
 
7
#
 
8
#       ./test-rem  # From WITHIN Remind source directory!
 
9
 
 
10
REM MSG Today is [hebday(today())] [hebmon(today())] [hebyear(today())]
 
11
.\test.rem(8): Trig = Saturday, 16 February, 1991
 
12
Reminders for Saturday, 16th February, 1991:
 
13
 
 
14
today() => 1991/02/16
 
15
hebday(1991/02/16) => 2
 
16
today() => 1991/02/16
 
17
hebmon(1991/02/16) => "Adar"
 
18
today() => 1991/02/16
 
19
hebyear(1991/02/16) => 5751
 
20
Today is 2 Adar 5751
 
21
 
 
22
fset _h(x, y) trigger(hebdate(x,y))
 
23
 
 
24
[_h(1,  "Tishrey")] MSG Rosh Hashana 1
 
25
Entering UserFN _h(1, "Tishrey")
 
26
x => 1
 
27
y => "Tishrey"
 
28
hebdate(1, "Tishrey") => 1991/09/09
 
29
trigger(1991/09/09) => "9 September 1991"
 
30
Leaving UserFN _h() => "9 September 1991"
 
31
.\test.rem(11): Trig = Monday, 9 September, 1991
 
32
[_h(2,  "Tishrey")] MSG Rosh Hashana 2
 
33
Entering UserFN _h(2, "Tishrey")
 
34
x => 2
 
35
y => "Tishrey"
 
36
hebdate(2, "Tishrey") => 1991/09/10
 
37
trigger(1991/09/10) => "10 September 1991"
 
38
Leaving UserFN _h() => "10 September 1991"
 
39
.\test.rem(12): Trig = Tuesday, 10 September, 1991
 
40
[_h(3,  "Tishrey")] MSG Tzom Gedalia
 
41
Entering UserFN _h(3, "Tishrey")
 
42
x => 3
 
43
y => "Tishrey"
 
44
hebdate(3, "Tishrey") => 1991/09/11
 
45
trigger(1991/09/11) => "11 September 1991"
 
46
Leaving UserFN _h() => "11 September 1991"
 
47
.\test.rem(13): Trig = Wednesday, 11 September, 1991
 
48
[_h(10, "Tishrey")] MSG Yom Kippur
 
49
Entering UserFN _h(10, "Tishrey")
 
50
x => 10
 
51
y => "Tishrey"
 
52
hebdate(10, "Tishrey") => 1991/09/18
 
53
trigger(1991/09/18) => "18 September 1991"
 
54
Leaving UserFN _h() => "18 September 1991"
 
55
.\test.rem(14): Trig = Wednesday, 18 September, 1991
 
56
[_h(15, "Tishrey")] MSG Sukkot 1
 
57
Entering UserFN _h(15, "Tishrey")
 
58
x => 15
 
59
y => "Tishrey"
 
60
hebdate(15, "Tishrey") => 1991/09/23
 
61
trigger(1991/09/23) => "23 September 1991"
 
62
Leaving UserFN _h() => "23 September 1991"
 
63
.\test.rem(15): Trig = Monday, 23 September, 1991
 
64
[_h(25, "Kislev")]  MSG Channuka
 
65
Entering UserFN _h(25, "Kislev")
 
66
x => 25
 
67
y => "Kislev"
 
68
hebdate(25, "Kislev") => 1991/12/02
 
69
trigger(1991/12/02) => "2 December 1991"
 
70
Leaving UserFN _h() => "2 December 1991"
 
71
.\test.rem(16): Trig = Monday, 2 December, 1991
 
72
[_h(10, "Tevet")]   MSG Asara B'Tevet
 
73
Entering UserFN _h(10, "Tevet")
 
74
x => 10
 
75
y => "Tevet"
 
76
hebdate(10, "Tevet") => 1991/12/17
 
77
trigger(1991/12/17) => "17 December 1991"
 
78
Leaving UserFN _h() => "17 December 1991"
 
79
.\test.rem(17): Trig = Tuesday, 17 December, 1991
 
80
[_h(15, "Shvat")]   MSG Tu B'Shvat
 
81
Entering UserFN _h(15, "Shvat")
 
82
x => 15
 
83
y => "Shvat"
 
84
hebdate(15, "Shvat") => 1992/01/20
 
85
trigger(1992/01/20) => "20 January 1992"
 
86
Leaving UserFN _h() => "20 January 1992"
 
87
.\test.rem(18): Trig = Monday, 20 January, 1992
 
88
[_h(15, "Adar A")]  MSG Purim Katan
 
89
Entering UserFN _h(15, "Adar A")
 
90
x => 15
 
91
y => "Adar A"
 
92
hebdate(15, "Adar A") => 1992/02/19
 
93
trigger(1992/02/19) => "19 February 1992"
 
94
Leaving UserFN _h() => "19 February 1992"
 
95
.\test.rem(19): Trig = Wednesday, 19 February, 1992
 
96
[_h(14, "Adar")]    MSG Purim
 
97
Entering UserFN _h(14, "Adar")
 
98
x => 14
 
99
y => "Adar"
 
100
hebdate(14, "Adar") => 1991/02/28
 
101
trigger(1991/02/28) => "28 February 1991"
 
102
Leaving UserFN _h() => "28 February 1991"
 
103
.\test.rem(20): Trig = Thursday, 28 February, 1991
 
104
[_h(15, "Nisan")]   MSG Pesach
 
105
Entering UserFN _h(15, "Nisan")
 
106
x => 15
 
107
y => "Nisan"
 
108
hebdate(15, "Nisan") => 1991/03/30
 
109
trigger(1991/03/30) => "30 March 1991"
 
110
Leaving UserFN _h() => "30 March 1991"
 
111
.\test.rem(21): Trig = Saturday, 30 March, 1991
 
112
[_h(27, "Nisan")]   MSG Yom HaShoah
 
113
Entering UserFN _h(27, "Nisan")
 
114
x => 27
 
115
y => "Nisan"
 
116
hebdate(27, "Nisan") => 1991/04/11
 
117
trigger(1991/04/11) => "11 April 1991"
 
118
Leaving UserFN _h() => "11 April 1991"
 
119
.\test.rem(22): Trig = Thursday, 11 April, 1991
 
120
[_h(4,  "Iyar")]    MSG Yom HaZikaron
 
121
Entering UserFN _h(4, "Iyar")
 
122
x => 4
 
123
y => "Iyar"
 
124
hebdate(4, "Iyar") => 1991/04/18
 
125
trigger(1991/04/18) => "18 April 1991"
 
126
Leaving UserFN _h() => "18 April 1991"
 
127
.\test.rem(23): Trig = Thursday, 18 April, 1991
 
128
[_h(5,  "Iyar")]    MSG Yom Ha'atzmaut
 
129
Entering UserFN _h(5, "Iyar")
 
130
x => 5
 
131
y => "Iyar"
 
132
hebdate(5, "Iyar") => 1991/04/19
 
133
trigger(1991/04/19) => "19 April 1991"
 
134
Leaving UserFN _h() => "19 April 1991"
 
135
.\test.rem(24): Trig = Friday, 19 April, 1991
 
136
[_h(28, "Iyar")]    MSG Yom Yerushalayim
 
137
Entering UserFN _h(28, "Iyar")
 
138
x => 28
 
139
y => "Iyar"
 
140
hebdate(28, "Iyar") => 1991/05/12
 
141
trigger(1991/05/12) => "12 May 1991"
 
142
Leaving UserFN _h() => "12 May 1991"
 
143
.\test.rem(25): Trig = Sunday, 12 May, 1991
 
144
[_h(6,  "Sivan")]   MSG Shavuot
 
145
Entering UserFN _h(6, "Sivan")
 
146
x => 6
 
147
y => "Sivan"
 
148
hebdate(6, "Sivan") => 1991/05/19
 
149
trigger(1991/05/19) => "19 May 1991"
 
150
Leaving UserFN _h() => "19 May 1991"
 
151
.\test.rem(26): Trig = Sunday, 19 May, 1991
 
152
[_h(9,  "Av")]      MSG Tish'a B'Av
 
153
Entering UserFN _h(9, "Av")
 
154
x => 9
 
155
y => "Av"
 
156
hebdate(9, "Av") => 1991/07/20
 
157
trigger(1991/07/20) => "20 July 1991"
 
158
Leaving UserFN _h() => "20 July 1991"
 
159
.\test.rem(27): Trig = Saturday, 20 July, 1991
 
160
 
 
161
# Test some jahrzeit cases
 
162
fset _i(x,y,z,a) trigger(hebdate(x,y,z,a))
 
163
[_i(30, "Heshvan", today(), 5759)] MSG Complete-Complete
 
164
today() => 1991/02/16
 
165
Entering UserFN _i(30, "Heshvan", 1991/02/16, 5759)
 
166
x => 30
 
167
y => "Heshvan"
 
168
z => 1991/02/16
 
169
a => 5759
 
170
hebdate(30, "Heshvan", 1991/02/16, 5759) => 1991/11/07
 
171
trigger(1991/11/07) => "7 November 1991"
 
172
Leaving UserFN _i() => "7 November 1991"
 
173
.\test.rem(31): Trig = Thursday, 7 November, 1991
 
174
[_i(30, "Heshvan", today(), 5760)] MSG Complete-Defective
 
175
today() => 1991/02/16
 
176
Entering UserFN _i(30, "Heshvan", 1991/02/16, 5760)
 
177
x => 30
 
178
y => "Heshvan"
 
179
z => 1991/02/16
 
180
a => 5760
 
181
hebdate(30, "Heshvan", 1991/02/16, 5760) => 1991/11/07
 
182
trigger(1991/11/07) => "7 November 1991"
 
183
Leaving UserFN _i() => "7 November 1991"
 
184
.\test.rem(32): Trig = Thursday, 7 November, 1991
 
185
[_i(30, "Heshvan", today(), 5761)] MSG Illegal
 
186
today() => 1991/02/16
 
187
Entering UserFN _i(30, "Heshvan", 1991/02/16, 5761)
 
188
x => 30
 
189
y => "Heshvan"
 
190
z => 1991/02/16
 
191
a => 5761
 
192
hebdate(30, "Heshvan", 1991/02/16, 5761) => .\test.rem(33): 30 Heshvan 5761: Invalid Hebrew date
 
193
Invalid Hebrew date
 
194
Leaving UserFN _i() => Invalid Hebrew date
 
195
 
 
196
[_i(30, "Kislev", today(), 5759)] MSG Complete-Complete
 
197
today() => 1991/02/16
 
198
Entering UserFN _i(30, "Kislev", 1991/02/16, 5759)
 
199
x => 30
 
200
y => "Kislev"
 
201
z => 1991/02/16
 
202
a => 5759
 
203
hebdate(30, "Kislev", 1991/02/16, 5759) => 1991/12/07
 
204
trigger(1991/12/07) => "7 December 1991"
 
205
Leaving UserFN _i() => "7 December 1991"
 
206
.\test.rem(35): Trig = Saturday, 7 December, 1991
 
207
[_i(30, "Kislev", today(), 5760)] MSG Complete-Defective
 
208
today() => 1991/02/16
 
209
Entering UserFN _i(30, "Kislev", 1991/02/16, 5760)
 
210
x => 30
 
211
y => "Kislev"
 
212
z => 1991/02/16
 
213
a => 5760
 
214
hebdate(30, "Kislev", 1991/02/16, 5760) => 1991/12/07
 
215
trigger(1991/12/07) => "7 December 1991"
 
216
Leaving UserFN _i() => "7 December 1991"
 
217
.\test.rem(36): Trig = Saturday, 7 December, 1991
 
218
[_i(30, "Kislev", today(), 5761)] MSG Illegal
 
219
today() => 1991/02/16
 
220
Entering UserFN _i(30, "Kislev", 1991/02/16, 5761)
 
221
x => 30
 
222
y => "Kislev"
 
223
z => 1991/02/16
 
224
a => 5761
 
225
hebdate(30, "Kislev", 1991/02/16, 5761) => .\test.rem(37): 30 Kislev 5761: Invalid Hebrew date
 
226
Invalid Hebrew date
 
227
Leaving UserFN _i() => Invalid Hebrew date
 
228
 
 
229
[_i(30, "Adar A", today(), 5755)] MSG Leap
 
230
today() => 1991/02/16
 
231
Entering UserFN _i(30, "Adar A", 1991/02/16, 5755)
 
232
x => 30
 
233
y => "Adar A"
 
234
z => 1991/02/16
 
235
a => 5755
 
236
hebdate(30, "Adar A", 1991/02/16, 5755) => 1992/03/05
 
237
trigger(1992/03/05) => "5 March 1992"
 
238
Leaving UserFN _i() => "5 March 1992"
 
239
.\test.rem(39): Trig = Thursday, 5 March, 1992
 
240
[_i(30, "Adar A", today(), 5756)] MSG Illegal
 
241
today() => 1991/02/16
 
242
Entering UserFN _i(30, "Adar A", 1991/02/16, 5756)
 
243
x => 30
 
244
y => "Adar A"
 
245
z => 1991/02/16
 
246
a => 5756
 
247
hebdate(30, "Adar A", 1991/02/16, 5756) => .\test.rem(40): No Adar A in 5756
 
248
Invalid Hebrew date
 
249
Leaving UserFN _i() => Invalid Hebrew date
 
250
[_i(29, "Adar A", today(), 5755)] MSG Leap
 
251
today() => 1991/02/16
 
252
Entering UserFN _i(29, "Adar A", 1991/02/16, 5755)
 
253
x => 29
 
254
y => "Adar A"
 
255
z => 1991/02/16
 
256
a => 5755
 
257
hebdate(29, "Adar A", 1991/02/16, 5755) => 1991/03/15
 
258
trigger(1991/03/15) => "15 March 1991"
 
259
Leaving UserFN _i() => "15 March 1991"
 
260
.\test.rem(41): Trig = Friday, 15 March, 1991
 
261
[_i(29, "Adar A", today(), 5756)] MSG Illegal
 
262
today() => 1991/02/16
 
263
Entering UserFN _i(29, "Adar A", 1991/02/16, 5756)
 
264
x => 29
 
265
y => "Adar A"
 
266
z => 1991/02/16
 
267
a => 5756
 
268
hebdate(29, "Adar A", 1991/02/16, 5756) => .\test.rem(42): No Adar A in 5756
 
269
Invalid Hebrew date
 
270
Leaving UserFN _i() => Invalid Hebrew date
 
271
 
 
272
# Test each possible case of the basic reminders.
 
273
 
 
274
REM MSG Every Day
 
275
.\test.rem(46): Trig = Saturday, 16 February, 1991
 
276
Every Day
 
277
 
 
278
 
 
279
REM 18 MSG Every 18th 
 
280
.\test.rem(48): Trig = Monday, 18 February, 1991
 
281
REM 15 MSG Every 15th
 
282
.\test.rem(49): Trig = Friday, 15 March, 1991
 
283
 
 
284
REM Feb MSG February
 
285
.\test.rem(51): Trig = Saturday, 16 February, 1991
 
286
February
 
287
 
 
288
REM Jan MSG January
 
289
.\test.rem(52): Trig = Wednesday, 1 January, 1992
 
290
REM March MSG March
 
291
.\test.rem(53): Trig = Friday, 1 March, 1991
 
292
 
 
293
REM 13 Jan MSG 13 Jan
 
294
.\test.rem(55): Trig = Monday, 13 January, 1992
 
295
REM 15 Feb MSG 15 Feb
 
296
.\test.rem(56): Trig = Saturday, 15 February, 1992
 
297
REM 28 Feb MSG 28 Feb
 
298
.\test.rem(57): Trig = Thursday, 28 February, 1991
 
299
REM 29 Feb MSG 29 Feb
 
300
.\test.rem(58): Trig = Saturday, 29 February, 1992
 
301
REM 5 Mar MSG 5 Mar
 
302
.\test.rem(59): Trig = Tuesday, 5 March, 1991
 
303
 
 
304
REM 1990 MSG 1990
 
305
.\test.rem(61): Expired
 
306
REM 1991 MSG 1991
 
307
.\test.rem(62): Trig = Saturday, 16 February, 1991
 
308
1991
 
309
 
 
310
REM 1992 MSG 1991
 
311
.\test.rem(63): Trig = Wednesday, 1 January, 1992
 
312
 
 
313
REM 1 1990 MSG 1 1990
 
314
.\test.rem(65): Expired
 
315
REM 29 1991 MSG 29 1991
 
316
.\test.rem(66): Trig = Friday, 29 March, 1991
 
317
REM 29 1992 MSG 29 1992
 
318
.\test.rem(67): Trig = Wednesday, 29 January, 1992
 
319
REM 16 1991 MSG 16 1991
 
320
.\test.rem(68): Trig = Saturday, 16 February, 1991
 
321
16 1991
 
322
 
 
323
 
 
324
REM Jan 1990 MSG Jan 1990
 
325
.\test.rem(70): Expired
 
326
REM Feb 1991 MSG Feb 1991
 
327
.\test.rem(71): Trig = Saturday, 16 February, 1991
 
328
Feb 1991
 
329
 
 
330
REM Dec 1991 MSG Dec 1991
 
331
.\test.rem(72): Trig = Sunday, 1 December, 1991
 
332
REM May 1992 MSG May 1992
 
333
.\test.rem(73): Trig = Friday, 1 May, 1992
 
334
 
 
335
REM 1 Jan 1991 MSG 1 Jan 1991
 
336
.\test.rem(75): Expired
 
337
REM 16 Feb 1991 MSG 16 Feb 1991
 
338
.\test.rem(76): Trig = Saturday, 16 February, 1991
 
339
16 Feb 1991
 
340
 
 
341
REM 29 Dec 1992 MSG 29 Dec 1992
 
342
.\test.rem(77): Trig = Tuesday, 29 December, 1992
 
343
 
 
344
REM Sun MSG Sun
 
345
.\test.rem(79): Trig = Sunday, 17 February, 1991
 
346
REM Fri Sat Tue MSG Fri Sat Tue
 
347
.\test.rem(80): Trig = Saturday, 16 February, 1991
 
348
Fri Sat Tue
 
349
 
 
350
 
 
351
REM Sun 16 MSG Sun 16
 
352
.\test.rem(82): Trig = Sunday, 17 February, 1991
 
353
REM Mon Tue Wed Thu Fri 1 MSG Mon Tue Wed Thu Fri 1
 
354
.\test.rem(83): Trig = Friday, 1 March, 1991
 
355
 
 
356
REM Sun Feb MSG Sun Feb
 
357
.\test.rem(85): Trig = Sunday, 17 February, 1991
 
358
REM Mon Tue March MSG Mon Tue March
 
359
.\test.rem(86): Trig = Monday, 4 March, 1991
 
360
 
 
361
REM Sun 16 Feb MSG Sun 16 Feb
 
362
.\test.rem(88): Trig = Sunday, 17 February, 1991
 
363
REM Mon Tue 10 March MSG Mon Tue 10 March
 
364
.\test.rem(89): Trig = Monday, 11 March, 1991
 
365
 
 
366
REM Sat Sun 1991 MSG Sat Sun 1991
 
367
.\test.rem(91): Trig = Saturday, 16 February, 1991
 
368
Sat Sun 1991
 
369
 
 
370
REM Mon Tue 1992 MSG Mon Tue 1992
 
371
.\test.rem(92): Trig = Monday, 6 January, 1992
 
372
 
 
373
REM Sun 16 1991 MSG Sun 16 1991
 
374
.\test.rem(94): Trig = Sunday, 17 February, 1991
 
375
REM Mon Tue Wed Thu Fri 1 1992 MSG Mon Tue Wed Thu Fri 1 1992
 
376
.\test.rem(95): Trig = Wednesday, 1 January, 1992
 
377
 
 
378
REM Mon Feb 1991 MSG Mon Feb 1991
 
379
.\test.rem(97): Trig = Monday, 18 February, 1991
 
380
REM Tue Jan 1992 MSG Tue Jan 1992
 
381
.\test.rem(98): Trig = Tuesday, 7 January, 1992
 
382
 
 
383
REM Sun Mon 16 Feb 1991 MSG Sun Mon 16 Feb 1991
 
384
.\test.rem(100): Trig = Sunday, 17 February, 1991
 
385
REM Tue 28 Jan 1992 MSG Tue 28 Jan 1992
 
386
.\test.rem(101): Trig = Tuesday, 28 January, 1992
 
387
 
 
388
# Try some Backs
 
389
CLEAR-OMIT-CONTEXT
 
390
REM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun
 
391
.\test.rem(105): Trig = Thursday, 28 February, 1991
 
392
REM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun
 
393
.\test.rem(106): Trig = Thursday, 28 February, 1991
 
394
 
 
395
OMIT 28 Feb
 
396
REM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun (28 Feb omitted)
 
397
.\test.rem(109): Trig = Wednesday, 27 February, 1991
 
398
REM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun (28 Feb omitted)
 
399
.\test.rem(110): Trig = Thursday, 28 February, 1991
 
400
 
 
401
CLEAR-OMIT-CONTEXT
 
402
 
 
403
# Try out UNTIL
 
404
REM Wed UNTIL 21 Feb 1991 MSG Wed UNTIL 21 Feb 1991
 
405
.\test.rem(115): Trig = Wednesday, 20 February, 1991
 
406
 
 
407
# Try playing with the OMIT context
 
408
 
 
409
OMIT 28 Feb 1991
 
410
REM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
 
411
.\test.rem(120): Trig = Wednesday, 27 February, 1991
 
412
REM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
 
413
.\test.rem(121): Trig = Thursday, 28 February, 1991
 
414
REM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
 
415
.\test.rem(122): Trig = Wednesday, 27 February, 1991
 
416
REM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
 
417
.\test.rem(123): Trig = Friday, 28 February, 1992
 
418
REM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
 
419
.\test.rem(124): Trig = Friday, 1 March, 1991
 
420
 
 
421
PUSH-OMIT-CONTEXT
 
422
CLEAR-OMIT-CONTEXT
 
423
REM 1 Mar -1 MSG 1 mar -1
 
424
.\test.rem(128): Trig = Thursday, 28 February, 1991
 
425
REM 1 Mar --1 MSG 1 mar --1
 
426
.\test.rem(129): Trig = Thursday, 28 February, 1991
 
427
REM 28 Feb BEFORE MSG 28 Feb BEFORE
 
428
.\test.rem(130): Trig = Thursday, 28 February, 1991
 
429
REM 28 Feb SKIP MSG 28 Feb SKIP 
 
430
.\test.rem(131): Trig = Thursday, 28 February, 1991
 
431
REM 28 Feb AFTER MSG 28 Feb AFTER
 
432
.\test.rem(132): Trig = Thursday, 28 February, 1991
 
433
 
 
434
POP-OMIT-CONTEXT
 
435
REM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
 
436
.\test.rem(135): Trig = Wednesday, 27 February, 1991
 
437
REM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
 
438
.\test.rem(136): Trig = Thursday, 28 February, 1991
 
439
REM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
 
440
.\test.rem(137): Trig = Wednesday, 27 February, 1991
 
441
REM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
 
442
.\test.rem(138): Trig = Friday, 28 February, 1992
 
443
REM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
 
444
.\test.rem(139): Trig = Friday, 1 March, 1991
 
445
 
 
446
 
 
447
REM 13 March 1991 *1 UNTIL 19 March 1991 MSG 13-19 Mar 91
 
448
.\test.rem(142): Trig = Wednesday, 13 March, 1991
 
449
 
 
450
# Test BACK
 
451
CLEAR-OMIT-CONTEXT
 
452
REM 18 Feb 1991 +1 MSG 18 Feb 1991 +1
 
453
.\test.rem(146): Trig = Monday, 18 February, 1991
 
454
 
 
455
OMIT 17 Feb 1991
 
456
REM 18 Feb 1991 +1 MSG 18 Feb 1991 +1 (17Feb91 omitted)
 
457
.\test.rem(149): Trig = Monday, 18 February, 1991
 
458
18 Feb 1991 +1 (17Feb91 omitted)
 
459
 
 
460
REM 18 Feb 1991 ++1 MSG 18 Feb 1991 ++1 (17Feb91 omitted)
 
461
.\test.rem(150): Trig = Monday, 18 February, 1991
 
462
 
 
463
CLEAR-OMIT-CONTEXT
 
464
# Test the scanfrom clause
 
465
REM Fri SATISFY 1
 
466
.\test.rem(154): Trig = Friday, 22 February, 1991
 
467
OMIT [trigger(trigdate())]
 
468
trigdate() => 1991/02/22
 
469
trigger(1991/02/22) => "22 February 1991"
 
470
REM Fri after MSG 23 Feb 1991
 
471
.\test.rem(156): Trig = Saturday, 23 February, 1991
 
472
CLEAR-OMIT-CONTEXT
 
473
REM Fri SCANFROM [trigger(today()-7)] SATISFY 1
 
474
today() => 1991/02/16
 
475
1991/02/16 - 7 => 1991/02/09
 
476
trigger(1991/02/09) => "9 February 1991"
 
477
.\test.rem(158): Trig = Friday, 15 February, 1991
 
478
OMIT [trigger(trigdate())]
 
479
trigdate() => 1991/02/15
 
480
trigger(1991/02/15) => "15 February 1991"
 
481
REM Fri after MSG 16 Feb 1991
 
482
.\test.rem(160): Trig = Saturday, 16 February, 1991
 
483
16 Feb 1991
 
484
 
 
485
CLEAR-OMIT-CONTEXT
 
486
set a000 abs(1)
 
487
abs(1) => 1
 
488
set a001 abs(-1)
 
489
- 1 => -1
 
490
abs(-1) => 1
 
491
set a002 asc("foo")
 
492
asc("foo") => 102
 
493
set a003 baseyr()
 
494
baseyr() => 1990
 
495
set a004 char(66,55,66,77,66)
 
496
char(66, 55, 66, 77, 66) => "B7BMB"
 
497
set a005 choose(3, "foo", "bar", "baz", "blech")
 
498
choose(3, "foo", "bar", "baz", "blech") => "baz"
 
499
set a006 coerce("string", 1)
 
500
coerce("string", 1) => "1"
 
501
set a007 coerce("string", today())
 
502
today() => 1991/02/16
 
503
coerce("string", 1991/02/16) => "1991/02/16"
 
504
set a008 coerce("string", 11:44)
 
505
coerce("string", 11:44) => "11:44"
 
506
set a009 coerce("int", "badnews")
 
507
coerce("int", "badnews") => Can't coerce
 
508
.\test.rem(171): Can't coerce
 
509
set a010 coerce("int", "12")
 
510
coerce("int", "12") => 12
 
511
set a011 coerce("int", 11:44)
 
512
coerce("int", 11:44) => 704
 
513
set a012 coerce("int", today())
 
514
today() => 1991/02/16
 
515
coerce("int", 1991/02/16) => 411
 
516
set a013 date(1992, 2, 2)
 
517
date(1992, 2, 2) => 1992/02/02
 
518
set a014 date(1993, 2, 29)
 
519
date(1993, 2, 29) => Bad date specification
 
520
.\test.rem(176): Bad date specification
 
521
set a015 day(today())
 
522
today() => 1991/02/16
 
523
day(1991/02/16) => 16
 
524
set a016 daysinmon(2, 1991)
 
525
daysinmon(2, 1991) => 28
 
526
set a017 daysinmon(2, 1992)
 
527
daysinmon(2, 1992) => 29
 
528
set a018 defined("a017")
 
529
defined("a017") => 1
 
530
set a019 defined("a019")
 
531
defined("a019") => 0
 
532
set a020 filename()
 
533
filename() => ".\test.rem"
 
534
set a021 getenv("TEST_GETENV")
 
535
getenv("TEST_GETENV") => "foo bar baz"
 
536
set a022 hour(11:22)
 
537
hour(11:22) => 11
 
538
set a023 iif(1, 1, 0)
 
539
iif(1, 1, 0) => 1
 
540
set a024 iif(0, 1, 0)
 
541
iif(0, 1, 0) => 0
 
542
set a025 index("barfoobar", "foo")
 
543
index("barfoobar", "foo") => 4
 
544
set a026 index("barfoobar", "bar", 2)
 
545
index("barfoobar", "bar", 2) => 7
 
546
set a027 isleap(today())
 
547
today() => 1991/02/16
 
548
isleap(1991/02/16) => 0
 
549
set a028 isleap(1992)
 
550
isleap(1992) => 1
 
551
omit [trigger(today())]
 
552
today() => 1991/02/16
 
553
trigger(1991/02/16) => "16 February 1991"
 
554
set a030 isomitted(today())
 
555
today() => 1991/02/16
 
556
isomitted(1991/02/16) => 1
 
557
clear
 
558
set a029 isomitted(today())
 
559
today() => 1991/02/16
 
560
isomitted(1991/02/16) => 0
 
561
set a031 lower("FOOBARBAZ")
 
562
lower("FOOBARBAZ") => "foobarbaz"
 
563
set a032 max(1, 2, 34, 1, 3)
 
564
max(1, 2, 34, 1, 3) => 34
 
565
set a033 max("foo", "bar", "baz")
 
566
max("foo", "bar", "baz") => "foo"
 
567
set a034 max(today(), today()+1, today()-1)
 
568
today() => 1991/02/16
 
569
today() => 1991/02/16
 
570
1991/02/16 + 1 => 1991/02/17
 
571
today() => 1991/02/16
 
572
1991/02/16 - 1 => 1991/02/15
 
573
max(1991/02/16, 1991/02/17, 1991/02/15) => 1991/02/17
 
574
set a035 min(1, 2, 34, 1, 3)
 
575
min(1, 2, 34, 1, 3) => 1
 
576
set a036 min("foo", "bar", "baz")
 
577
min("foo", "bar", "baz") => "bar"
 
578
set a037 min(today(), today()+1, today()-1)
 
579
today() => 1991/02/16
 
580
today() => 1991/02/16
 
581
1991/02/16 + 1 => 1991/02/17
 
582
today() => 1991/02/16
 
583
1991/02/16 - 1 => 1991/02/15
 
584
min(1991/02/16, 1991/02/17, 1991/02/15) => 1991/02/15
 
585
set a038 minute(11:33)
 
586
minute(11:33) => 33
 
587
set a039 mon(today())
 
588
today() => 1991/02/16
 
589
mon(1991/02/16) => "February"
 
590
set a040 monnum(today())
 
591
today() => 1991/02/16
 
592
monnum(1991/02/16) => 2
 
593
set a041 ord(3)
 
594
ord(3) => "3rd"
 
595
set a042 ord(4)
 
596
ord(4) => "4th"
 
597
set a043 ostype()
 
598
ostype() => "OS/2"
 
599
set a044 plural(2)
 
600
plural(2) => "s"
 
601
set a045 plural(2, "ies")
 
602
plural(2, "ies") => "iess"
 
603
set a046 plural(2, "y", "ies")
 
604
plural(2, "y", "ies") => "ies"
 
605
set a047 sgn(-2)
 
606
- 2 => -2
 
607
sgn(-2) => -1
 
608
set a048 shell("echo foo")
 
609
shell("echo foo") => "foo"
 
610
set a049 strlen("sadjflkhsldkfhsdlfjhk")
 
611
strlen("sadjflkhsldkfhsdlfjhk") => 21
 
612
set a050 substr(a049, 2)
 
613
a049 => 21
 
614
substr(21, 2) => Type mismatch
 
615
.\test.rem(214): Type mismatch
 
616
set a051 substr(a050, 2, 6)
 
617
a050 => .\test.rem(215): Undefined variable: a050
 
618
set a052 time(1+2, 3+4)
 
619
1 + 2 => 3
 
620
3 + 4 => 7
 
621
time(3, 7) => 03:07
 
622
rem 10 jan 1992 AT 11:22 CAL
 
623
.\test.rem(217): Trig = Friday, 10 January, 1992
 
624
set a053 trigdate()
 
625
trigdate() => 1992/01/10
 
626
set a054 trigtime()
 
627
trigtime() => 11:22
 
628
set a055 trigvalid()
 
629
trigvalid() => 1
 
630
set a056 upper("sdfjhsdf ksjdfh kjsdfh ksjdfh")
 
631
upper("sdfjhsdf ksjdfh kjsdfh ksjdfh") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
 
632
set a057 value("a05"+"6")
 
633
"a05" + "6" => "a056"
 
634
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
 
635
set a058 version()
 
636
version() => "03.00.19"
 
637
set a059 wkday(today())
 
638
today() => 1991/02/16
 
639
wkday(1991/02/16) => "Saturday"
 
640
set a060 wkdaynum(today())
 
641
today() => 1991/02/16
 
642
wkdaynum(1991/02/16) => 6
 
643
set a061 year(today())
 
644
today() => 1991/02/16
 
645
year(1991/02/16) => 1991
 
646
set a062 1+2*(3+4-(5*7/2))
 
647
3 + 4 => 7
 
648
5 * 7 => 35
 
649
35 / 2 => 17
 
650
7 - 17 => -10
 
651
2 * -10 => -20
 
652
1 + -20 => -19
 
653
set a063 1>=2
 
654
1 >= 2 => 0
 
655
set a064 1<2 || 3 > 4
 
656
1 < 2 => 1
 
657
3 > 4 => 0
 
658
1 || 0 => 1
 
659
set a065 1 && 1
 
660
1 && 1 => 1
 
661
set a066 !a065
 
662
a065 => 1
 
663
! 1 => 0
 
664
set a067 typeof(2)
 
665
typeof(2) => "INT"
 
666
set a068 typeof("foo")
 
667
typeof("foo") => "STRING"
 
668
set a069 typeof(11:33)
 
669
typeof(11:33) => "TIME"
 
670
set a070 typeof(today())
 
671
today() => 1991/02/16
 
672
typeof(1991/02/16) => "DATE"
 
673
fset g(x,y) max(x,y)
 
674
fset h(x,y) min(g(x+y, x*y), g(x-y, x/y))
 
675
set a071 g(1, 2)
 
676
Entering UserFN g(1, 2)
 
677
x => 1
 
678
y => 2
 
679
max(1, 2) => 2
 
680
Leaving UserFN g() => 2
 
681
set a072 h(2, 3)
 
682
Entering UserFN h(2, 3)
 
683
x => 2
 
684
y => 3
 
685
2 + 3 => 5
 
686
x => 2
 
687
y => 3
 
688
2 * 3 => 6
 
689
Entering UserFN g(5, 6)
 
690
x => 5
 
691
y => 6
 
692
max(5, 6) => 6
 
693
Leaving UserFN g() => 6
 
694
x => 2
 
695
y => 3
 
696
2 - 3 => -1
 
697
x => 2
 
698
y => 3
 
699
2 / 3 => 0
 
700
Entering UserFN g(-1, 0)
 
701
x => -1
 
702
y => 0
 
703
max(-1, 0) => 0
 
704
Leaving UserFN g() => 0
 
705
min(6, 0) => 0
 
706
Leaving UserFN h() => 0
 
707
set a073 h("foo", 11:33)
 
708
Entering UserFN h("foo", 11:33)
 
709
x => "foo"
 
710
y => 11:33
 
711
"foo" + 11:33 => "foo11:33"
 
712
x => "foo"
 
713
y => 11:33
 
714
"foo" * 11:33 => Type mismatch
 
715
.\test.rem(240): `*': Type mismatch
 
716
Leaving UserFN h() => Type mismatch
 
717
set a074 dosubst("%a %b %c %d %e %f %g %h", '1992/5/5')
 
718
dosubst("%a %b %c %d %e %f %g %h", 1992/05/05) => "on Tuesday, 5 May, 1992 in 444 days' tim"...
 
719
msg [a074]%
 
720
.\test.rem(242): Trig = Saturday, 16 February, 1991
 
721
a074 => "on Tuesday, 5 May, 1992 in 444 days' tim"...
 
722
on Tuesday, 5 May, 1992 in 444 days' time on Tuesday 5 on 05/05/1992 on 05/05/1992 on Tuesday, 5 May on 05/05
 
723
set a075 dosubst("%i %j %k %l %m %n %o %p", '1992/5/5')
 
724
dosubst("%i %j %k %l %m %n %o %p", 1992/05/05) => "on 05/05 on Tuesday, May 5th, 1992 on Tu"...
 
725
msg [a075]%
 
726
.\test.rem(244): Trig = Saturday, 16 February, 1991
 
727
a075 => "on 05/05 on Tuesday, May 5th, 1992 on Tu"...
 
728
on 05/05 on Tuesday, May 5th, 1992 on Tuesday, May 5th on 1992/05/05 May 5  s
 
729
set a076 dosubst("%q %r %s %t %u %v %w %x", '1992/5/5')
 
730
dosubst("%q %r %s %t %u %v %w %x", 1992/05/05) => "s' 05 th 05 on Tuesday, 5th May, 1992 on"...
 
731
msg [a076]%
 
732
.\test.rem(246): Trig = Saturday, 16 February, 1991
 
733
a076 => "s' 05 th 05 on Tuesday, 5th May, 1992 on"...
 
734
s' 05 th 05 on Tuesday, 5th May, 1992 on Tuesday, 5th May Tuesday 444
 
735
set a077 dosubst("%y %z", '1992/5/5')
 
736
dosubst("%y %z", 1992/05/05) => "1992 92
 
737
"
 
738
msg [a077]%
 
739
.\test.rem(248): Trig = Saturday, 16 February, 1991
 
740
a077 => "1992 92
 
741
"
 
742
1992 92
 
743
set a078 easterdate(today())
 
744
today() => 1991/02/16
 
745
easterdate(1991/02/16) => 1991/03/31
 
746
set a079 easterdate(1992)
 
747
easterdate(1992) => 1992/04/19
 
748
set a080 easterdate(1995)
 
749
easterdate(1995) => 1995/04/16
 
750
set a081 ""
 
751
dump
 
752
    Variable  Value
 
753
 
 
754
        a017  29
 
755
        a036  "bar"
 
756
        a055  1
 
757
        a074  "on Tuesday, 5 May, 1992 in 444 days' tim"...
 
758
        a008  "11:44"
 
759
        a027  0
 
760
        a046  "ies"
 
761
        a065  1
 
762
        a018  1
 
763
        a037  1991/02/15
 
764
        a056  "SDFJHSDF KSJDFH KJSDFH KSJDFH"
 
765
        a075  "on 05/05 on Tuesday, May 5th, 1992 on Tu"...
 
766
        a028  1
 
767
        a047  -1
 
768
        a066  0
 
769
        a019  0
 
770
        a038  33
 
771
        a057  "SDFJHSDF KSJDFH KJSDFH KSJDFH"
 
772
        a076  "s' 05 th 05 on Tuesday, 5th May, 1992 on"...
 
773
        a029  0
 
774
        a048  "foo"
 
775
        a067  "INT"
 
776
        a039  "February"
 
777
        a058  "03.00.19"
 
778
        a077  "1992 92
 
779
"
 
780
        a049  21
 
781
        a068  "STRING"
 
782
        a059  "Saturday"
 
783
        a078  1991/03/31
 
784
        a069  "TIME"
 
785
        a079  1992/04/19
 
786
        a000  1
 
787
        a010  12
 
788
        a001  1
 
789
        a020  ".\test.rem"
 
790
        a011  704
 
791
        a030  1
 
792
        a002  102
 
793
        a021  "foo bar baz"
 
794
        a040  2
 
795
        a012  411
 
796
        a031  "foobarbaz"
 
797
        a003  1990
 
798
        a022  11
 
799
        a041  "3rd"
 
800
        a060  6
 
801
        a013  1992/02/02
 
802
        a032  34
 
803
        a070  "DATE"
 
804
        a004  "B7BMB"
 
805
        a023  1
 
806
        a042  "4th"
 
807
        a061  1991
 
808
        a080  1995/04/16
 
809
        a033  "foo"
 
810
        a052  03:07
 
811
        a071  2
 
812
        a005  "baz"
 
813
        a024  0
 
814
        a043  "OS/2"
 
815
        a062  -19
 
816
        a081  ""
 
817
        a015  16
 
818
        a034  1991/02/17
 
819
        a053  1992/01/10
 
820
        a072  0
 
821
        a006  "1"
 
822
        a025  4
 
823
        a044  "s"
 
824
        a063  0
 
825
        a016  28
 
826
        a035  1
 
827
        a054  11:22
 
828
        a007  "1991/02/16"
 
829
        a026  7
 
830
        a045  "iess"
 
831
        a064  1
 
832