b4850d7ebdc07eaac3b4123edaed7c6bd6662962
[pspp-builds.git] / tests / expressions / expressions.sh
1 #! /bin/sh
2
3 # Tests the expression optimizer and evaluator.
4
5 TEMPDIR=/tmp/pspp-tst-$$
6
7 here=`pwd`;
8
9 # ensure that top_srcdir is absolute
10 cd $top_srcdir; top_srcdir=`pwd`
11
12 STAT_CONFIG_PATH=$top_srcdir/config
13 export STAT_CONFIG_PATH
14
15
16 cleanup()
17 {
18      cd /
19      rm -rf $TEMPDIR
20 }
21
22
23 fail()
24 {
25     echo $activity
26     echo FAILED
27     cleanup;
28     exit 1;
29 }
30
31
32 no_result()
33 {
34     echo $activity
35     echo NO RESULT;
36     cleanup;
37     exit 2;
38 }
39
40 pass()
41 {
42     cleanup;
43     exit 0;
44 }
45
46 mkdir -p $TEMPDIR
47
48 cd $TEMPDIR
49 activity="create expressions list"
50 sed -ne 's/#.*//;/^[    ]*$/!p' > $TEMPDIR/expr-list <<'EOF'
51
52 # Number syntax.
53 1e2 => 100.00
54 1e+2 => 100.00
55 1e-2 => 0.01
56 1e-99 => 0.00
57
58 # Test using numeric/string values as Booleans and vice-versa
59 0 AND 1 => false
60 $true AND 1 => true
61 1 OR $false => true
62 1 OR $sysmis => true
63 2 OR $sysmis => sysmis
64 2 AND $sysmis => false
65 'string' AND $sysmis => error
66 0 AND $sysmis => false
67 (1>2) + 1 => 1.00
68 $true + $false => 1.00
69
70 # Addition and subtraction.
71 1 + 2 => 3.00
72 1 + $true => 2.00
73 $sysmis + 1 => sysmis
74 7676 + $sysmis => sysmis
75 ('foo') + 5 => error
76 ('foo') + ('bar') => error      # Arithmetic concatenation requires CONCAT.
77 'foo' + 'bar' => "foobar"       # Lexical concatentation succeeds.
78 1 +3 - 2 +4 -5 => 1.00
79 1 - $true => 0.00
80 $true - 4/3 => -0.33
81 'string' - 1e10 => error
82 9.5 - '' => error
83 1 - 2 => -1.00
84 52 -23 => 29.00 
85
86 # Multiplication and division
87 5 * 10 => 50.00
88 10 * $true => 10.00
89 $true * 5 => 5.00
90 1.5 * $true => 1.50
91 5 * $sysmis => sysmis
92 $sysmis * 15 => sysmis
93 2 * 5 / 10 => 1.00
94 1 / 2 => 0.50
95 2 / 5 => 0.40
96 12 / 3 / 2 => 2.00
97
98 # Exponentiation.
99 2**8 => 256.00
100 (2**3)**4 => 4096.00    # Irritating, but compatible.
101 2**3**4 => 4096.00
102
103 # Unary minus.
104 2+-3 => -1.00
105 2*-3 => -6.00
106 -3**2 => -9.00
107 (-3)**2 => 9.00
108 2**-1 => 0.50
109 0**0 => sysmis
110 0**-1 => sysmis
111 (-3)**1.5 => sysmis
112
113 # AND truth table.
114 $false AND $false => false
115 $false AND $true => false
116 $false AND $sysmis => false
117 $true AND $false => false
118 $true AND $true => true
119 $true AND $sysmis => sysmis
120 $sysmis AND $false => false
121 $sysmis AND $true => sysmis
122 $sysmis AND $sysmis => sysmis
123 $false & $false => false
124 $false & $true => false
125 $false & $sysmis => false
126 $true & $false => false
127 $true & $true => true
128 $true & $sysmis => sysmis
129 $sysmis & $false => false
130 $sysmis & $true => sysmis
131 $sysmis & $sysmis => sysmis
132
133 # OR truth table.
134 $false OR $false => false
135 $false OR $true => true
136 $false OR $sysmis => sysmis
137 $true OR $false => true
138 $true OR $true => true
139 $true OR $sysmis => true
140 $sysmis OR $false => sysmis
141 $sysmis OR $true => true
142 $sysmis OR $sysmis => sysmis
143 $false | $false => false
144 $false | $true => true
145 $false | $sysmis => sysmis
146 $true | $false => true
147 $true | $true => true
148 $true | $sysmis => true
149 $sysmis | $false => sysmis
150 $sysmis | $true => true
151 $sysmis | $sysmis => sysmis
152
153 # NOT truth table.
154 not $false => true
155 not 0 => true
156 not 2.5 => true
157 not $true => false
158 not 1 => false
159 not $sysmis => sysmis
160 ~ $false => true
161 ~ 0 => true
162 ~ 2.5 => true
163 ~ $true => false
164 ~ 1 => false
165 ~ $sysmis => sysmis
166
167 # Relational operators.
168 1 eq 1 => true
169 1 = 1 => true
170 1 eq 2 => false
171 2 = 3 => false
172 1 eq 'foobar' => error
173 5 eq 'foobar' => error
174 'baz' = 10 => error
175 'quux' = 5.55 => error
176 'foobar' = 'foobar' => true
177 'quux' = 'bar' => false
178 'bar   ' = 'bar' => true
179 'asdf         ' = 'asdf  ' => true
180 'asdfj   ' = 'asdf' => false
181 1 + 2 = 3 => true               # Check precedence.
182 1 >= 2 = 2 ge 3 => false        # Check precedence.
183 3 ne 2 ~= 1 => false            # Mathematically true.
184 3 > 2 > 1 => false              # Mathematically true.
185
186 1 <= 2 => true
187 2.5 <= 1.5 => false
188 1 le 2 => true
189 2 <= 2 => true
190 2 le 2 => true
191 2 < = 2 => error        # Make sure <= token can't be split.
192 1 <= 'foobar' => error
193 5 <= 'foobar' => error
194 'baz' <= 10 => error
195 'quux' <= 5.55 => error
196 '0123' <= '0123' => true
197 '0123' <= '0124' => true
198 '0124' le '0123' => false
199 '0123  ' <= '0123' => true
200 '0123' le '0123  ' => true
201
202 1 < 2 => true
203 2.5 < 1.5 => false
204 3.5 lt 4 => true
205 4 lt 3.5 => false
206 1 lt 'foobar' => error
207 5 lt 'foobar' => error
208 'baz' < 10 => error
209 'quux' < 5.55 => error
210 '0123' lt '0123' => false
211 '0123' < '0124' => true
212 '0124' lt '0123' => false
213 '0123  ' < '0123' => false
214 '0123' lt '0123  ' => false
215
216 1 >= 2 => false
217 2.5 >= 1.5 => true
218 1 ge 2 => false
219 2 >= 2 => true
220 2 ge 2 => true
221 2 > = 2 => error        # Make sure >= token can't be split.
222 1 >= 'foobar' => error
223 5 ge 'foobar' => error
224 'baz' ge 10 => error
225 'quux' >= 5.55 => error
226 '0123' ge '0123' => true
227 '0123' >= '0124' => false
228 '0124' >= '0123' => true
229 '0123  ' ge '0123' => true
230 '0123' >= '0123  ' => true
231
232 1 > 2 => false
233 2.5 > 1.5 => true
234 3.5 gt 4 => false
235 4 gt 3.5 => true
236 1 gt 'foobar' => error
237 5 gt 'foobar' => error
238 'baz' > 10 => error
239 'quux' > 5.55 => error
240 '0123' gt '0123' => false
241 '0123' > '0124' => false
242 '0124' gt '0123' => true
243 '0123  ' > '0123' => false
244 '0123' gt '0123  ' => false
245
246 1 ne 1 => false
247 1 ~= 1 => false
248 1 <> 2 => true
249 2 ne 3 => true
250 1 ~= 'foobar' => error
251 5 <> 'foobar' => error
252 'baz' ne 10 => error
253 'quux' ~= 5.55 => error
254 'foobar' <> 'foobar' => false
255 'quux' ne 'bar' => true
256 'bar   ' <> 'bar' => false
257 'asdf         ' ~= 'asdf  ' => false
258 'asdfj   ' ne 'asdf' => true
259 1 < > 1 => error        # <> token can't be split
260 1 ~ = 1 => error        # ~= token can't be split
261
262 exp(10) => 22026.47
263 exp('x') => error
264
265 lg10(500) => 2.70
266 lg10('x') => error
267
268 ln(10) => 2.30
269 ln('x') => error
270
271 sqrt(500) => 22.36
272 sqrt('x') => error
273
274 abs(-10.5) => 10.50
275 abs(-55.79) => 55.79
276 abs(22) => 22.00
277 abs(0) => 0.00
278
279 mod(55.5, 2) => 1.50
280 mod(-55.5, 2) => -1.50
281 mod(55.5, -2) => 1.50
282 mod(-55.5, -2) => -1.50
283 mod('a', 2) => error
284 mod(2, 'a') => error
285 mod('a', 'b') => error
286
287 mod10(55.5) => 5.50
288 mod10(-55.5) => -5.50
289 mod10('x') => error
290
291 rnd(5.4) => 5.00
292 rnd(5.6) => 6.00
293 rnd(-5.4) => -5.00
294 rnd(-5.6) => -6.00
295 rnd('x') => error
296
297 trunc(1.2) => 1.00
298 trunc(1.9) => 1.00
299 trunc(-1.2) => -1.00
300 trunc(-1.9) => -1.00
301 trunc('x') => error
302
303 acos(.5) / 3.14159 * 180 => 60.00
304 arcos(.75) / 3.14159 * 180 => 41.41
305 arcos(-.5) / 3.14159 * 180 => 120.00
306 acos(-.75) / 3.14159 * 180 => 138.59
307 acos(-1) / 3.14159 * 180 => 180.00
308 arcos(1) / 3.14159 * 180 => 0.00
309 acos(-1.01) => sysmis
310 arcos(1.01) => sysmis
311 acos('x') => error
312
313 arsin(.5) / 3.14159 * 180 => 30.00
314 asin(.25) / 3.14159 * 180 => 14.48
315 arsin(-.5) / 3.14159 * 180 => -30.00
316 asin(-.25) / 3.14159 * 180 => -14.48
317 arsin(-1.01) => sysmis
318 asin(1.01) => sysmis
319 arsin('x') => error
320
321 artan(1) / 3.14159 * 180 => 45.00
322 atan(10) / 3.14159 * 180 => 84.29
323 artan(-1) / 3.14159 * 180 => -45.00
324 atan(-10) / 3.14159 * 180 => -84.29
325 artan('x') => error
326
327 cos(60 / 180 * 3.14159) => 0.50
328 cos(45 / 180 * 3.14159) => 0.71
329 cos(30 / 180 * 3.14159) => 0.87
330 cos(15 / 180 * 3.14159) => 0.97
331 cos(-60 / 180 * 3.14159) => 0.50
332 cos(-45 / 180 * 3.14159) => 0.71
333 cos(-30 / 180 * 3.14159) => 0.87
334 cos(-15 / 180 * 3.14159) => 0.97
335 cos(123 / 180 * 3.14159) => -0.54
336 cos(321 / 180 * 3.14159) => 0.78
337 cos('x') => error
338
339 sin(60 / 180 * 3.14159) => 0.87
340 sin(45 / 180 * 3.14159) => 0.71
341 sin(30 / 180 * 3.14159) => 0.50
342 sin(15 / 180 * 3.14159) => 0.26
343 sin(-60 / 180 * 3.14159) => -0.87
344 sin(-45 / 180 * 3.14159) => -0.71
345 sin(-30 / 180 * 3.14159) => -0.50
346 sin(-15 / 180 * 3.14159) => -0.26
347 sin(123 / 180 * 3.14159) => 0.84
348 sin(321 / 180 * 3.14159) => -0.63
349 sin('x') => error
350
351 tan(60 / 180 * 3.14159) => 1.73
352 tan(45 / 180 * 3.14159) => 1.00
353 tan(30 / 180 * 3.14159) => 0.58
354 tan(15 / 180 * 3.14159) => 0.27
355 tan(-60 / 180 * 3.14159) => -1.73
356 tan(-45 / 180 * 3.14159) => -1.00
357 tan(-30 / 180 * 3.14159) => -0.58
358 tan(-15 / 180 * 3.14159) => -0.27
359 tan(123 / 180 * 3.14159) => -1.54
360 tan(321 / 180 * 3.14159) => -0.81
361 tan('x') => error
362
363 # FIXME: a variable name as the argument to SYSMIS is a special case
364 # that we don't yet test.  We also can't test VALUE this way.
365 missing(10) => false
366 missing($sysmis) => true
367 missing(asin(1.01)) => true
368 missing(asin(.5)) => false
369 missing('    ') => error
370 nmiss($sysmis) => 1.00
371 nmiss(0) => 0.00
372 nmiss($sysmis, $sysmis, $sysmis) => 3.00
373 nmiss(1, 2, 3, 4) => 0.00
374 nmiss(1, $sysmis, $sysmis, 2, 2, $sysmis, $sysmis, 3, 4) => 4.00
375 nvalid($sysmis) => 0.00
376 nvalid(0) => 1.00
377 nvalid($sysmis, $sysmis, $sysmis) => 0.00
378 nvalid(1, 2, 3, 4) => 4.00
379 nvalid(1, $sysmis, $sysmis, 2, 2, $sysmis, $sysmis, 3, 4) => 5.00
380 sysmis(10) => false
381 sysmis($sysmis) => true
382 sysmis(asin(1.01)) => true
383 sysmis(asin(.5)) => false
384 sysmis('    ') => error
385
386 any($sysmis, 1, $sysmis, 3) => sysmis
387 any(1, 1, 2, 3) => true
388 any(1, $true, 2, 3) => true
389 any(1, $false, 2, 3) => false
390 any(2, 1, 2, 3) => true
391 any(3, 1, 2, 3) => true
392 any(5, 1, 2, 3) => false
393 any(1, 1, 1, 1) => true
394 any($sysmis, 1, 1, 1) => sysmis
395 any(1, $sysmis, $sysmis, $sysmis) => sysmis
396 any($sysmis, $sysmis, $sysmis, $sysmis) => sysmis
397 any(1) => error
398 any('1', 2, 3, 4) => error
399 any(1, '2', 3, 4) => error
400 any(1, 2, '3', 4) => error
401 any(1, 2, 3, '4') => error
402
403 any('', 'a', '', 'c') => true
404 any('a', 'a', 'b', 'c') => true
405 any('b', 'a', 'b', 'c') => true
406 any('c', 'a', 'b', 'c') => true
407 any('e', 'a', 'b', 'c') => false
408 any('a', 'a', 'a', 'a') => true
409 any('', 'a', 'a', 'a') => false
410 any('a', '', '', '') => false
411 any('a') => error
412 any('a', 'a  ', 'b', 'c') => true
413 any('b   ', 'a', 'b', 'c') => true
414 any('c   ', 'a', 'b', 'c     ') => true
415 any(a, 'b', 'c', 'd') => error
416 any('a', b, 'c', 'd') => error
417 any('a', 'b', c, 'd') => error
418 any('a', 'b', 'c', d) => error
419
420 range(5, 1, 10) => true
421 range(1, 1, 10) => true
422 range(10, 1, 10) => true
423 range(-1, 1, 10) => false
424 range(12, 1, 10) => false
425 range($sysmis, 1, 10) => sysmis
426 range(5, 1, $sysmis) => sysmis
427 range(5, $sysmis, 10) => sysmis
428 range($sysmis, $sysmis, 10) => sysmis 
429 range($sysmis, 1, $sysmis) => sysmis
430 range($sysmis, $sysmis, $sysmis) => sysmis
431 range(0, 1, 8, 10, 18) => false
432 range(1, 1, 8, 10, 18) => true
433 range(6, 1, 8, 10, 18) => true
434 range(8, 1, 8, 10, 18) => true
435 range(9, 1, 8, 10, 18) => false
436 range(10, 1, 8, 10, 18) => true
437 range(13, 1, 8, 10, 18) => true
438 range(16, 1, 8, 10, 18) => true
439 range(18, 1, 8, 10, 18) => true
440 range(20, 1, 8, 10, 18) => false
441 range(1) => error
442 range(1, 2) => error
443 range(1, 2, 3, 4) => error
444 range(1, 2, 3, 4, 5, 6) => error
445 range('1', 2, 3) => error
446 range(1, '2', 3) => error
447 range(1, 2, '3') => error
448
449 range('123', '111', '888') => true
450 range('111', '111', '888') => true
451 range('888', '111', '888') => true
452 range('110', '111', '888') => false
453 range('889', '111', '888') => false
454 range('000', '111', '888') => false
455 range('999', '111', '888') => false
456 range('123   ', '111', '888') => true
457 range('123', '111   ', '888') => true
458 range('123', '111', '888   ') => true
459 range('123', '111    ', '888   ') => true
460 range('00', '01', '08', '10', '18') => false
461 range('01', '01', '08', '10', '18') => true
462 range('06', '01', '08', '10', '18') => true
463 range('08', '01', '08', '10', '18') => true
464 range('09', '01', '08', '10', '18') => false
465 range('10', '01', '08', '10', '18') => true
466 range('15', '01', '08', '10', '18') => true
467 range('18', '01', '08', '10', '18') => true
468 range('19', '01', '08', '10', '18') => false
469 range('1') => error
470 range('1', '2') => error
471 range('1', '2', '3', '4') => error
472 range('1', '2', '3', '4', '5', '6') => error
473 range(1, '2', '3') => error
474 range('1', 2, '3') => error
475 range('1', '2', 3) => error
476
477 cfvar(1, 2, 3, 4, 5) => 0.53
478 cfvar(1, $sysmis, 2, 3, $sysmis, 4, 5) => 0.53
479 cfvar(1, 2) => 0.47
480 cfvar(1) => error
481 cfvar(1, $sysmis) => sysmis
482 cfvar(1, 2, 3, $sysmis) => 0.50
483 cfvar.4(1, 2, 3, $sysmis) => sysmis
484 cfvar.4(1, 2, 3) => error
485 cfvar('x') => error
486 cfvar('x', 1, 2, 3) => error
487
488 max(1, 2, 3, 4, 5) => 5.00
489 max(1, $sysmis, 2, 3, $sysmis, 4, 5) => 5.00
490 max(1, 2) => 2.00
491 max() => error
492 max(1) => 1.00
493 max(1, $sysmis) => 1.00
494 max(1, 2, 3, $sysmis) => 3.00
495 max.4(1, 2, 3, $sysmis) => sysmis
496 max.4(1, 2, 3) => error
497
498 max("2", "3", "5", "1", "4") => "5"
499 max("1", "2") => "2"
500 max("1") => "1"
501
502 mean(1, 2, 3, 4, 5) => 3.00
503 mean(1, $sysmis, 2, 3, $sysmis, 4, 5) => 3.00
504 mean(1, 2) => 1.50
505 mean() => error
506 mean(1) => 1.00
507 mean(1, $sysmis) => 1.00
508 mean(1, 2, 3, $sysmis) => 2.00
509 mean.4(1, 2, 3, $sysmis) => sysmis
510 mean.4(1, 2, 3) => error
511
512 min(1, 2, 3, 4, 5) => 1.00
513 min(1, $sysmis, 2, 3, $sysmis, 4, 5) => 1.00
514 min(1, 2) => 1.00
515 min() => error
516 min(1) => 1.00
517 min(1, $sysmis) => 1.00
518 min(1, 2, 3, $sysmis) => 1.00
519 min.4(1, 2, 3, $sysmis) => sysmis
520 min.4(1, 2, 3) => error
521
522 min("2", "3", "5", "1", "4") => "1"
523 min("1", "2") => "1"
524 min("1") => "1"
525
526 sd(1, 2, 3, 4, 5) => 1.58
527 sd(1, $sysmis, 2, 3, $sysmis, 4, 5) => 1.58
528 sd(1, 2) => 0.71
529 sd(1) => error
530 sd(1, $sysmis) => sysmis
531 sd(1, 2, 3, $sysmis) => 1.00
532 sd.4(1, 2, 3, $sysmis) => sysmis
533 sd.4(1, 2, 3) => error
534 sd('x') => error
535 sd('x', 1, 2, 3) => error
536
537 sum(1, 2, 3, 4, 5) => 15.00
538 sum(1, $sysmis, 2, 3, $sysmis, 4, 5) => 15.00
539 sum(1, 2) => 3.00
540 sum() => error
541 sum(1) => 1.00
542 sum(1, $sysmis) => 1.00
543 sum(1, 2, 3, $sysmis) => 6.00
544 sum.4(1, 2, 3, $sysmis) => sysmis
545 sum.4(1, 2, 3) => error
546
547 variance(1, 2, 3, 4, 5) => 2.50
548 variance(1, $sysmis, 2, 3, $sysmis, 4, 5) => 2.50
549 variance(1, 2) => 0.50
550 variance(1) => error
551 variance(1, $sysmis) => sysmis
552 variance(1, 2, 3, $sysmis) => 1.00
553 variance.4(1, 2, 3, $sysmis) => sysmis
554 variance.4(1, 2, 3) => error
555 variance('x') => error
556 variance('x', 1, 2, 3) => error
557
558 concat('') => ""
559 concat('a', 'b') => "ab"
560 concat('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h') => "abcdefgh"
561 concat('abcdefgh', 'ijklmnopq') => "abcdefghijklmnopq"
562 concat('a', 1) => error
563 concat(1, 2) => error
564
565 index('abcbcde', 'bc') => 2.00
566 index('abcbcde', 'bcd') => 4.00
567 index('abcbcde', 'bcbc') => 2.00
568 index('abcdefgh', 'abc') => 1.00
569 index('abcdefgh', 'bcd') => 2.00
570 index('abcdefgh', 'cde') => 3.00
571 index('abcdefgh', 'def') => 4.00
572 index('abcdefgh', 'efg') => 5.00
573 index('abcdefgh', 'fgh') => 6.00
574 index('abcdefgh', 'fghi') => 0.00
575 index('abcdefgh', 'x') => 0.00
576 index('abcdefgh', 'abch') => 0.00
577 index('banana', 'na') => 3.00
578 index('banana', 'ana') => 2.00
579 index('', 'x') => 0.00
580 index('', '') => sysmis
581 index('abcdefgh', '') => sysmis
582 index('abcdefgh', 'alkjsfdjlskalkjfa') => 0.00
583
584 index('abcbcde', 'bc', 1) => 2.00
585 index('abcbcde', 'dc', 1) => 3.00
586 index('abcbcde', 'abc', 1) => 1.00
587 index('abcbcde', 'bc', 2) => 2.00
588 index('abcbcde', 'dc', 2) => 0.00
589 index('abcbcde', 'abc', 1) => 1.00
590 index('abcbcde', 'bccb', 2) => 2.00
591 index('abcbcde', 'bcbc', 2) => 2.00
592 index('abcbcde', 'bcbc', $sysmis) => sysmis
593
594 rindex('abcbcde', 'bc') => 4.00
595 rindex('abcbcde', 'bcd') => 4.00
596 rindex('abcbcde', 'bcbc') => 2.00
597 rindex('abcdefgh', 'abc') => 1.00
598 rindex('abcdefgh', 'bcd') => 2.00
599 rindex('abcdefgh', 'cde') => 3.00
600 rindex('abcdefgh', 'def') => 4.00
601 rindex('abcdefgh', 'efg') => 5.00
602 rindex('abcdefgh', 'fgh') => 6.00
603 rindex('abcdefgh', 'fghi') => 0.00
604 rindex('abcdefgh', 'x') => 0.00
605 rindex('abcdefgh', 'abch') => 0.00
606 rindex('banana', 'na') => 5.00
607 rindex('banana', 'ana') => 4.00
608 rindex('', 'x') => 0.00
609 rindex('', '') => sysmis
610 rindex('abcdefgh', '') => sysmis
611 rindex('abcdefgh', 'alkjsfdjlskalkjfa') => 0.00
612
613 rindex('abcbcde', 'bc', 1) => 5.00
614 rindex('abcbcde', 'dc', 1) => 6.00
615 rindex('abcbcde', 'abc', 1) => 5.00
616 rindex('abcbcde', 'bc', 2) => 4.00
617 rindex('abcbcde', 'dc', 2) => 0.00
618 rindex('abcbcde', 'abc', 1) => 5.00
619 rindex('abcbcde', 'bccb', 2) => 4.00
620 rindex('abcbcde', 'bcbc', 2) => 4.00
621 rindex('abcbcde', 'bcbc', $sysmis) => sysmis
622 rindex('abcbcde', 'bcbcg', 2) => sysmis
623 rindex('abcbcde', 'bcbcg', $sysmis) => sysmis
624 rindex('abcbcde', 'bcbcg', 'x') => error
625 rindex(1, 'bcdfkjl', 2) => error
626 rindex('aksj', 2, 2) => error
627 rindex(1, 2, 3) => error
628 rindex(1, 2, '3') => error
629
630 length('') => 0.00
631 length('a') => 1.00
632 length('xy') => 2.00
633 length('adsf    ') => 8.00
634 length('abcdefghijkl') => 12.00
635 length(0) => error
636 length($sysmis) => error
637
638 lower('ABCDEFGHIJKLMNOPQRSTUVWXYZ!@%&*(089') => "abcdefghijklmnopqrstuvwxyz!@%&*(089"
639 lower('') => ""
640 lower(1) => error
641
642 lpad('abc', -1) => ""
643 lpad('abc', 0) => "abc"
644 lpad('abc', 2) => "abc"
645 lpad('abc', 3) => "abc"
646 lpad('abc', 10) => "       abc"
647 lpad('abc', 256) => ""
648 lpad('abc', $sysmis) => ""
649 lpad('abc', -1, '*') => ""
650 lpad('abc', 0, '*') => "abc"
651 lpad('abc', 2, '*') => "abc"
652 lpad('abc', 3, '*') => "abc"
653 lpad('abc', 10, '*') => "*******abc"
654 lpad('abc', 256, '*') => ""
655 lpad('abc', $sysmis, '*') => ""
656 lpad('abc', $sysmis, '') => ""
657 lpad('abc', $sysmis, 'xy') => ""
658 lpad(0, 10) => error
659 lpad('abc', 'def') => error
660 lpad(0, 10, ' ') => error
661 lpad('abc', 'def', ' ') => error
662 lpad('x', 5, 0) => error
663 lpad('x', 5, 2) => error
664
665 number("123", f3.0) => 123.00
666 number(" 123", f3.0) => 12.00
667 number("123", f3.1) => 12.30
668 number("   ", f3.1) => sysmis
669 number("123", a8) => error
670 number("123", cca1.2) => error  # CCA is not an input format
671
672 ltrim('   abc') => "abc"
673 rtrim('   abc   ') => "   abc"
674 ltrim('abc') => "abc"
675 ltrim(' abc') => "      abc"
676 ltrim('    ') => ""
677 ltrim('') => ""
678 ltrim(8) => error
679 ltrim('***abc', '*') => "abc"
680 ltrim('abc', '*') => "abc"
681 ltrim('*abc', '*') => "abc"
682 ltrim('', '*') => ""
683 ltrim(8, '*') => error
684 ltrim(' x', 8) => error
685 ltrim(8, 9) => error
686
687 rpad('abc', -1) => ""
688 rpad('abc', 0) => "abc"
689 rpad('abc', 2) => "abc"
690 rpad('abc', 3) => "abc"
691 rpad('abc', 10) => "abc       "
692 rpad('abc', 256) => ""
693 rpad('abc', $sysmis) => ""
694 rpad('abc', -1, '*') => ""
695 rpad('abc', 0, '*') => "abc"
696 rpad('abc', 2, '*') => "abc"
697 rpad('abc', 3, '*') => "abc"
698 rpad('abc', 10, '*') => "abc*******"
699 rpad('abc', 256, '*') => ""
700 rpad('abc', $sysmis, '*') => ""
701 rpad('abc', $sysmis, '') => ""
702 rpad('abc', $sysmis, 'xy') => ""
703 rpad(0, 10) => error
704 rpad('abc', 'def') => error
705 rpad(0, 10, ' ') => error
706 rpad('abc', 'def', ' ') => error
707 rpad('x', 5, 0) => error
708 rpad('x', 5, 2) => error
709
710 rtrim('abc   ') => "abc"
711 rtrim('   abc   ') => "   abc"
712 rtrim('abc') => "abc"
713 rtrim('abc      ') => "abc      "
714 rtrim('    ') => ""
715 rtrim('') => ""
716 rtrim(8) => error
717 rtrim('abc***', '*') => "abc"
718 rtrim('abc', '*') => "abc"
719 rtrim('abc*', '*') => "abc"
720 rtrim('', '*') => ""
721 rtrim(8, '*') => error
722 rtrim(' x', 8) => error
723 rtrim(8, 9) => error
724
725 string(123.56, f5.1) => "123.6"
726 string($sysmis, f5.1) => "   . "
727 string("abc", A5) => error
728 string(123, e1) => error        # E has a minimum width of 6 on output.
729 string(123, e6.0) => " 1E+02"
730
731 substr('abcdefgh', -5) => ""
732 substr('abcdefgh', 0) => ""
733 substr('abcdefgh', 1) => "abcdefgh"
734 substr('abcdefgh', 3) => "cdefgh"
735 substr('abcdefgh', 5) => "efgh"
736 substr('abcdefgh', 6) => "fgh"
737 substr('abcdefgh', 7) => "gh"
738 substr('abcdefgh', 8) => "h"
739 substr('abcdefgh', 9) => ""
740 substr('abcdefgh', 10) => ""
741 substr('abcdefgh', 20) => ""
742 substr('abcdefgh', $sysmis) => ""
743 substr(0, 10) => error
744 substr('abcd', 'abc') => error
745 substr(0, 'abc') => error
746
747 substr('abcdefgh', 0, 0) => ""
748 substr('abcdefgh', 3, 0) => ""
749 substr('abcdefgh', 5, 0) => ""
750 substr('abcdefgh', 9, 0) => ""
751 substr('abcdefgh', 0, 1) => ""
752 substr('abcdefgh', 0, 5) => ""
753 substr('abcdefgh', 1, 8) => "abcdefgh"
754 substr('abcdefgh', 1, 10) => "abcdefgh"
755 substr('abcdefgh', 1, 20) => "abcdefgh"
756 substr('abcdefgh', 3, 4) => "cdef"
757 substr('abcdefgh', 5, 2) => "ef"
758 substr('abcdefgh', 6, 1) => "f"
759 substr('abcdefgh', 7, 10) => "gh"
760 substr('abcdefgh', 8, 1) => "h"
761 substr('abcdefgh', 8, 2) => "h"
762 substr('abcdefgh', 9, 11) => ""
763 substr('abcdefgh', 10, 52) => ""
764 substr('abcdefgh', 20, 1) => ""
765 substr('abcdefgh', $sysmis, 2) => ""
766 substr('abcdefgh', 9, $sysmis) => ""
767 substr('abcdefgh', $sysmis, $sysmis) => ""
768 substr('abc', 1, 'x') => error
769 substr(0, 10, 1) => error
770 substr(0, 10, 'x') => error
771 substr('abcd', 'abc', 0) => error
772 substr('abcd', 'abc', 'j') => error
773 substr(0, 'abc', 4) => error
774 substr(0, 'abc', 'k') => error
775
776 upcase('abcdefghijklmnopqrstuvwxyz!@%&*(089') => "ABCDEFGHIJKLMNOPQRSTUVWXYZ!@%&*(089"
777 upcase('') => ""
778 upcase(1) => error
779
780 time.days(1) => 86400.00
781 time.days(-1) => -86400.00
782 time.days(0.5) => 43200.00
783 time.days('x') => error
784 time.days($sysmis) => sysmis
785
786 time.hms(4,50,38) => 17438.00
787 time.hms(12,31,35) => 45095.00
788 time.hms(12,47,53) => 46073.00
789 time.hms(1,26,0) => 5160.00
790 time.hms(20,58,11) => 75491.00
791 time.hms(7,36,5) => 27365.00
792 time.hms(15,43,49) => 56629.00
793 time.hms(4,25,9) => 15909.00
794 time.hms(6,49,27) => 24567.00
795 time.hms(2,57,52) => 10672.00
796 time.hms(16,45,44) => 60344.00
797 time.hms(21,30,57) => 77457.00
798 time.hms(22,30,4) => 81004.00
799 time.hms(1,56,51) => 7011.00
800 time.hms(5, 6, 7) => 18367.00
801 time.hms(5, 6, 0) => 18360.00
802 time.hms(5, 0, 7) => 18007.00
803 time.hms(0, 6, 7) => 367.00
804 time.hms(-5, 6, -7) => sysmis
805 time.hms(-5, 5, -7) => sysmis
806 time.hms($sysmis, 6, 7) => sysmis
807 time.hms(5, $sysmis, 7) => sysmis
808 time.hms(5, $sysmis, 7) => sysmis
809 time.hms($sysmis, $sysmis, 7) => sysmis
810 time.hms(5, $sysmis, $sysmis) => sysmis
811 time.hms($sysmis, $sysmis, 7) => sysmis
812 time.hms($sysmis, $sysmis, $sysmis) => sysmis
813
814 ctime.days(106272) => 1.23
815 ctime.hours(106272) => 29.52
816 ctime.minutes(106272) => 1771.20
817 ctime.seconds(106272) => 106272.00
818 ctime.days(-106272) => -1.23
819 ctime.hours(-106272) => -29.52
820 ctime.minutes(-106272) => -1771.20
821 ctime.seconds(-106272) => -106272.00
822 ctime.days($sysmis) => sysmis
823 ctime.hours($sysmis) => sysmis
824 ctime.minutes($sysmis) => sysmis
825 ctime.seconds($sysmis) => sysmis
826 ctime.days('a') => error
827 ctime.hours('b') => error
828 ctime.minutes('c') => error
829 ctime.seconds('d') => error
830
831 ctime.days(date.dmy(15,10,1582)) => 1.00
832 ctime.days(date.dmy(6,9,1719)) => 50000.00
833 ctime.days(date.dmy(24,1,1583)) => 102.00
834 ctime.days(date.dmy(14,12,1585)) => 1157.00
835 ctime.days(date.dmy(26,11,1621)) => 14288.00
836 ctime.days(date.dmy(25,12,1821)) => 87365.00
837 ctime.days(date.dmy(3,12,1882)) => 109623.00
838 ctime.days(date.dmy(6,4,2002)) => 153211.00
839 ctime.days(date.dmy(19,12,1999)) => 152372.00
840 ctime.days(date.dmy(1,10,1978)) => 144623.00
841 ctime.days(date.dmy(0,10,1978)) => 144622.00
842 ctime.days(date.dmy(32,10,1978)) => sysmis
843 ctime.days(date.dmy(31,0,1978)) => 144349.00
844 ctime.days(date.dmy(31,13,1978)) => 144745.00
845 ctime.days(date.dmy($sysmis,10,1978)) => sysmis
846 ctime.days(date.dmy(31,$sysmis,1978)) => sysmis
847 ctime.days(date.dmy(31,10,$sysmis)) => sysmis
848 ctime.days(date.dmy($sysmis,$sysmis,1978)) => sysmis
849 ctime.days(date.dmy(31,$sysmis,$sysmis)) => sysmis
850 ctime.days(date.dmy($sysmis,10,$sysmis)) => sysmis
851 ctime.days(date.dmy($sysmis,$sysmis,$sysmis)) => sysmis
852 date.dmy('a',1,2) => error
853 date.dmy(1,'a',2) => error
854 date.dmy(1,2,'a') => error
855 # FIXME: check out-of-range and nearly out-of-range values
856
857 yrmoda(1582,10,15) => 1.00
858 yrmoda(1719,9,6) => 50000.00
859 yrmoda(1583,1,24) => 102.00
860 yrmoda(1585,12,14) => 1157.00
861 yrmoda(1621,11,26) => 14288.00
862 yrmoda(1821,12,25) => 87365.00
863 yrmoda(1882,12,3) => 109623.00
864 yrmoda(2002,4,6) => 153211.00
865 yrmoda(1999,12,19) => 152372.00
866 yrmoda(1978,10,1) => 144623.00
867 yrmoda(1978,10,0) => 144622.00
868 yrmoda(1978,10,32) => sysmis
869 yrmoda(1978,0,31) => 144349.00
870 yrmoda(1978,13,31) => 144745.00
871 yrmoda(1978,10,$sysmis) => sysmis
872 yrmoda(1978,$sysmis,31) => sysmis
873 yrmoda($sysmis,10,31) => sysmis
874 yrmoda(1978,$sysmis,$sysmis) => sysmis
875 yrmoda($sysmis,$sysmis,31) => sysmis
876 yrmoda($sysmis,10,$sysmis) => sysmis
877 yrmoda($sysmis,$sysmis,$sysmis) => sysmis
878 yrmoda('a',1,2) => error
879 yrmoda(1,'a',2) => error
880 yrmoda(1,2,'a') => error
881 # FIXME: check out-of-range and nearly out-of-range values
882
883 ctime.days(date.mdy(6,10,1648)) + 577735 => 601716.00
884 ctime.days(date.mdy(6,30,1680)) + 577735 => 613424.00
885 ctime.days(date.mdy(7,24,1716)) + 577735 => 626596.00
886 ctime.days(date.mdy(6,19,1768)) + 577735 => 645554.00
887 ctime.days(date.mdy(8,2,1819)) + 577735 => 664224.00
888 ctime.days(date.mdy(3,27,1839)) + 577735 => 671401.00
889 ctime.days(date.mdy(4,19,1903)) + 577735 => 694799.00
890 ctime.days(date.mdy(8,25,1929)) + 577735 => 704424.00
891 ctime.days(date.mdy(9,29,1941)) + 577735 => 708842.00
892 ctime.days(date.mdy(4,19,1943)) + 577735 => 709409.00
893 ctime.days(date.mdy(10,7,1943)) + 577735 => 709580.00
894 ctime.days(date.mdy(3,17,1992)) + 577735 => 727274.00
895 ctime.days(date.mdy(2,25,1996)) + 577735 => 728714.00
896 ctime.days(date.mdy(11,10,2038)) + 577735 => 744313.00
897 ctime.days(date.mdy(7,18,2094)) + 577735 => 764652.00
898 # FIXME: check out-of-range and nearly out-of-range values
899
900 ctime.days(date.mdy(10,15,1582)) => 1.00
901 ctime.days(date.mdy(9,6,1719)) => 50000.00
902 ctime.days(date.mdy(1,24,1583)) => 102.00
903 ctime.days(date.mdy(12,14,1585)) => 1157.00
904 ctime.days(date.mdy(11,26,1621)) => 14288.00
905 ctime.days(date.mdy(12,25,1821)) => 87365.00
906 ctime.days(date.mdy(12,3,1882)) => 109623.00
907 ctime.days(date.mdy(4,6,2002)) => 153211.00
908 ctime.days(date.mdy(12,19,1999)) => 152372.00
909 ctime.days(date.mdy(10,1,1978)) => 144623.00
910 ctime.days(date.mdy(10,0,1978)) => 144622.00
911 ctime.days(date.mdy(10,32,1978)) => sysmis
912 ctime.days(date.mdy(0,31,1978)) => 144349.00
913 ctime.days(date.mdy(13,31,1978)) => 144745.00
914 ctime.days(date.mdy(10,$sysmis,1978)) => sysmis
915 ctime.days(date.mdy($sysmis,31,1978)) => sysmis
916 ctime.days(date.mdy(10,31,$sysmis)) => sysmis
917 ctime.days(date.mdy($sysmis,$sysmis,1978)) => sysmis
918 ctime.days(date.mdy($sysmis,31,$sysmis)) => sysmis
919 ctime.days(date.mdy(10,$sysmis,$sysmis)) => sysmis
920 ctime.days(date.mdy($sysmis,$sysmis,$sysmis)) => sysmis
921 date.mdy('a',1,2) => error
922 date.mdy(1,'a',2) => error
923 date.mdy(1,2,'a') => error
924 ctime.days(date.mdy(0,0,0)) => 152353.00
925 ctime.days(date.mdy(0,0,999)) => sysmis
926 date.mdy(1,1,1582) => sysmis
927 date.mdy(10,14,1582) => sysmis
928 date.mdy(10,15,1582) => 86400.00
929
930 ctime.days(date.moyr(1,2000)) => 152385.00
931 ctime.days(date.moyr(2,2000)) => 152416.00
932 ctime.days(date.moyr(3,2000)) => 152445.00
933 ctime.days(date.moyr(4,2000)) => 152476.00
934 ctime.days(date.moyr(5,2000)) => 152506.00
935 ctime.days(date.moyr(13,2000)) => 152751.00
936 ctime.days(date.moyr(14,2000)) => sysmis
937 ctime.days(date.moyr($sysmis,2000)) => sysmis
938 ctime.days(date.moyr(1,$sysmis)) => sysmis
939 ctime.days(date.moyr($sysmis,$sysmis)) => sysmis
940 date.moyr('a',2000) => error
941 date.moyr(5,'a') => error
942 date.moyr('a','b') => error
943
944 ctime.days(date.qyr(1,2000)) => 152385.00
945 ctime.days(date.qyr(2,2000)) => 152476.00
946 ctime.days(date.qyr(5,2000)) => 152751.00
947 ctime.days(date.qyr(6,2000)) => sysmis
948 ctime.days(date.qyr($sysmis,2000)) => sysmis
949 ctime.days(date.qyr(1,$sysmis)) => sysmis
950 ctime.days(date.qyr($sysmis,$sysmis)) => sysmis
951 date.qyr('a',2000) => error
952 date.qyr(5,'a') => error
953 date.qyr('a','b') => error
954
955 ctime.days(date.wkyr(1,2000)) => 152385.00
956 ctime.days(date.wkyr(15,1999)) => 152118.00
957 ctime.days(date.wkyr(36,1999)) => 152265.00
958 ctime.days(date.wkyr(54,1999)) => sysmis
959 ctime.days(date.wkyr($sysmis,1999)) => sysmis
960 ctime.days(date.wkyr(1,$sysmis)) => sysmis
961 ctime.days(date.wkyr($sysmis,$sysmis)) => sysmis
962 date.wkyr('a',1999) => error
963 date.wkyr(5,'a') => error
964 date.wkyr('a','b') => error
965
966 ctime.days(date.yrday(2000,1)) => 152385.00
967 ctime.days(date.yrday(2000,100)) => 152484.00
968 ctime.days(date.yrday(2000,253)) => 152637.00
969 ctime.days(date.yrday(2000,500)) => sysmis
970 ctime.days(date.yrday(2000,-100)) => sysmis
971 ctime.days(date.yrday(1999,$sysmis)) => sysmis
972 ctime.days(date.yrday($sysmis,1)) => sysmis
973 ctime.days(date.yrday($sysmis,$sysmis)) => sysmis
974 date.yrday(1999,'a') => error
975 date.yrday('a',5) => error
976 date.yrday('a','b') => error
977
978 xdate.date(date.mdy(6,10,1648) + time.hms(0,0,0)) / 86400 => 23981.00
979 xdate.date(date.mdy(6,30,1680) + time.hms(4,50,38)) / 86400 => 35689.00
980 xdate.date(date.mdy(7,24,1716) + time.hms(12,31,35)) / 86400 => 48861.00
981 xdate.date(date.mdy(6,19,1768) + time.hms(12,47,53)) / 86400 => 67819.00
982 xdate.date(date.mdy(8,2,1819) + time.hms(1,26,0)) / 86400 => 86489.00
983 xdate.date(date.mdy(3,27,1839) + time.hms(20,58,11)) / 86400 => 93666.00
984 xdate.date(date.mdy(4,19,1903) + time.hms(7,36,5)) / 86400 => 117064.00
985 xdate.date(date.mdy(8,25,1929) + time.hms(15,43,49)) / 86400 => 126689.00
986 xdate.date(date.mdy(9,29,1941) + time.hms(4,25,9)) / 86400 => 131107.00
987 xdate.date(date.mdy(4,19,1943) + time.hms(6,49,27)) / 86400 => 131674.00
988 xdate.date(date.mdy(10,7,1943) + time.hms(2,57,52)) / 86400 => 131845.00
989 xdate.date(date.mdy(3,17,1992) + time.hms(16,45,44)) / 86400 => 149539.00
990 xdate.date(date.mdy(2,25,1996) + time.hms(21,30,57)) / 86400 => 150979.00
991 xdate.date(date.mdy(9,29,41) + time.hms(4,25,9)) / 86400 => 131107.00
992 xdate.date(date.mdy(4,19,43) + time.hms(6,49,27)) / 86400 => 131674.00
993 xdate.date(date.mdy(10,7,43) + time.hms(2,57,52)) / 86400 => 131845.00
994 xdate.date(date.mdy(3,17,92) + time.hms(16,45,44)) / 86400 => 149539.00
995 xdate.date(date.mdy(2,25,96) + time.hms(21,30,57)) / 86400 => 150979.00
996 xdate.date(date.mdy(11,10,2038) + time.hms(22,30,4)) / 86400 => 166578.00
997 xdate.date(date.mdy(7,18,2094) + time.hms(1,56,51)) / 86400 => 186917.00
998 xdate.date(123.4) => 0.00
999 xdate.date('') => error
1000
1001 xdate.hour(date.mdy(6,10,1648) + time.hms(0,0,0)) => 0.00
1002 xdate.hour(date.mdy(6,30,1680) + time.hms(4,50,38)) => 4.00
1003 xdate.hour(date.mdy(7,24,1716) + time.hms(12,31,35)) => 12.00
1004 xdate.hour(date.mdy(6,19,1768) + time.hms(12,47,53)) => 12.00
1005 xdate.hour(date.mdy(8,2,1819) + time.hms(1,26,0)) => 1.00
1006 xdate.hour(date.mdy(3,27,1839) + time.hms(20,58,11)) => 20.00
1007 xdate.hour(date.mdy(4,19,1903) + time.hms(7,36,5)) => 7.00
1008 xdate.hour(date.mdy(8,25,1929) + time.hms(15,43,49)) => 15.00
1009 xdate.hour(date.mdy(9,29,1941) + time.hms(4,25,9)) => 4.00
1010 xdate.hour(date.mdy(4,19,1943) + time.hms(6,49,27)) => 6.00
1011 xdate.hour(date.mdy(10,7,1943) + time.hms(2,57,52)) => 2.00
1012 xdate.hour(date.mdy(3,17,1992) + time.hms(16,45,44)) => 16.00
1013 xdate.hour(date.mdy(2,25,1996) + time.hms(21,30,57)) => 21.00
1014 xdate.hour(date.mdy(9,29,41) + time.hms(4,25,9)) => 4.00
1015 xdate.hour(date.mdy(4,19,43) + time.hms(6,49,27)) => 6.00
1016 xdate.hour(date.mdy(10,7,43) + time.hms(2,57,52)) => 2.00
1017 xdate.hour(date.mdy(3,17,92) + time.hms(16,45,44)) => 16.00
1018 xdate.hour(date.mdy(2,25,96) + time.hms(21,30,57)) => 21.00
1019 xdate.hour(date.mdy(11,10,2038) + time.hms(22,30,4)) => 22.00
1020 xdate.hour(date.mdy(7,18,2094) + time.hms(1,56,51)) => 1.00
1021 xdate.hour(-1) => -1.00
1022 xdate.hour(1) => 0.00
1023 xdate.hour($sysmis) => sysmis
1024 xdate.hour('') => error
1025
1026 xdate.jday(date.mdy(6,10,1648) + time.hms(0,0,0)) => 162.00
1027 xdate.jday(date.mdy(6,30,1680) + time.hms(4,50,38)) => 182.00
1028 xdate.jday(date.mdy(7,24,1716) + time.hms(12,31,35)) => 206.00
1029 xdate.jday(date.mdy(6,19,1768) + time.hms(12,47,53)) => 171.00
1030 xdate.jday(date.mdy(8,2,1819) + time.hms(1,26,0)) => 214.00
1031 xdate.jday(date.mdy(3,27,1839) + time.hms(20,58,11)) => 86.00
1032 xdate.jday(date.mdy(4,19,1903) + time.hms(7,36,5)) => 109.00
1033 xdate.jday(date.mdy(8,25,1929) + time.hms(15,43,49)) => 237.00
1034 xdate.jday(date.mdy(9,29,1941) + time.hms(4,25,9)) => 272.00
1035 xdate.jday(date.mdy(4,19,1943) + time.hms(6,49,27)) => 109.00
1036 xdate.jday(date.mdy(10,7,1943) + time.hms(2,57,52)) => 280.00
1037 xdate.jday(date.mdy(3,17,1992) + time.hms(16,45,44)) => 77.00
1038 xdate.jday(date.mdy(2,25,1996) + time.hms(21,30,57)) => 56.00
1039 xdate.jday(date.mdy(9,29,41) + time.hms(4,25,9)) => 272.00
1040 xdate.jday(date.mdy(4,19,43) + time.hms(6,49,27)) => 109.00
1041 xdate.jday(date.mdy(10,7,43) + time.hms(2,57,52)) => 280.00
1042 xdate.jday(date.mdy(3,17,92) + time.hms(16,45,44)) => 77.00
1043 xdate.jday(date.mdy(2,25,96) + time.hms(21,30,57)) => 56.00
1044 xdate.jday(date.mdy(11,10,2038) + time.hms(22,30,4)) => 314.00
1045 xdate.jday(date.mdy(7,18,2094) + time.hms(1,56,51)) => 199.00
1046 xdate.jday(0) => sysmis
1047 xdate.jday(1) => sysmis
1048 xdate.jday(86400) => 288.00
1049
1050 xdate.mday(date.mdy(6,10,1648) + time.hms(0,0,0)) => 10.00
1051 xdate.mday(date.mdy(6,30,1680) + time.hms(4,50,38)) => 30.00
1052 xdate.mday(date.mdy(7,24,1716) + time.hms(12,31,35)) => 24.00
1053 xdate.mday(date.mdy(6,19,1768) + time.hms(12,47,53)) => 19.00
1054 xdate.mday(date.mdy(8,2,1819) + time.hms(1,26,0)) => 2.00
1055 xdate.mday(date.mdy(3,27,1839) + time.hms(20,58,11)) => 27.00
1056 xdate.mday(date.mdy(4,19,1903) + time.hms(7,36,5)) => 19.00
1057 xdate.mday(date.mdy(8,25,1929) + time.hms(15,43,49)) => 25.00
1058 xdate.mday(date.mdy(9,29,1941) + time.hms(4,25,9)) => 29.00
1059 xdate.mday(date.mdy(4,19,1943) + time.hms(6,49,27)) => 19.00
1060 xdate.mday(date.mdy(10,7,1943) + time.hms(2,57,52)) => 7.00
1061 xdate.mday(date.mdy(3,17,1992) + time.hms(16,45,44)) => 17.00
1062 xdate.mday(date.mdy(2,25,1996) + time.hms(21,30,57)) => 25.00
1063 xdate.mday(date.mdy(9,29,41) + time.hms(4,25,9)) => 29.00
1064 xdate.mday(date.mdy(4,19,43) + time.hms(6,49,27)) => 19.00
1065 xdate.mday(date.mdy(10,7,43) + time.hms(2,57,52)) => 7.00
1066 xdate.mday(date.mdy(3,17,92) + time.hms(16,45,44)) => 17.00
1067 xdate.mday(date.mdy(2,25,96) + time.hms(21,30,57)) => 25.00
1068 xdate.mday(date.mdy(11,10,2038) + time.hms(22,30,4)) => 10.00
1069 xdate.mday(date.mdy(7,18,2094) + time.hms(1,56,51)) => 18.00
1070
1071 xdate.minute(date.mdy(6,10,1648) + time.hms(0,0,0)) => 0.00
1072 xdate.minute(date.mdy(6,30,1680) + time.hms(4,50,38)) => 50.00
1073 xdate.minute(date.mdy(7,24,1716) + time.hms(12,31,35)) => 31.00
1074 xdate.minute(date.mdy(6,19,1768) + time.hms(12,47,53)) => 47.00
1075 xdate.minute(date.mdy(8,2,1819) + time.hms(1,26,0)) => 26.00
1076 xdate.minute(date.mdy(3,27,1839) + time.hms(20,58,11)) => 58.00
1077 xdate.minute(date.mdy(4,19,1903) + time.hms(7,36,5)) => 36.00
1078 xdate.minute(date.mdy(8,25,1929) + time.hms(15,43,49)) => 43.00
1079 xdate.minute(date.mdy(9,29,1941) + time.hms(4,25,9)) => 25.00
1080 xdate.minute(date.mdy(4,19,1943) + time.hms(6,49,27)) => 49.00
1081 xdate.minute(date.mdy(10,7,1943) + time.hms(2,57,52)) => 57.00
1082 xdate.minute(date.mdy(3,17,1992) + time.hms(16,45,44)) => 45.00
1083 xdate.minute(date.mdy(2,25,1996) + time.hms(21,30,57)) => 30.00
1084 xdate.minute(date.mdy(9,29,41) + time.hms(4,25,9)) => 25.00
1085 xdate.minute(date.mdy(4,19,43) + time.hms(6,49,27)) => 49.00
1086 xdate.minute(date.mdy(10,7,43) + time.hms(2,57,52)) => 57.00
1087 xdate.minute(date.mdy(3,17,92) + time.hms(16,45,44)) => 45.00
1088 xdate.minute(date.mdy(2,25,96) + time.hms(21,30,57)) => 30.00
1089 xdate.minute(date.mdy(11,10,2038) + time.hms(22,30,4)) => 30.00
1090 xdate.minute(date.mdy(7,18,2094) + time.hms(1,56,51)) => 56.00
1091
1092 xdate.month(date.mdy(6,10,1648) + time.hms(0,0,0)) => 6.00
1093 xdate.month(date.mdy(6,30,1680) + time.hms(4,50,38)) => 6.00
1094 xdate.month(date.mdy(7,24,1716) + time.hms(12,31,35)) => 7.00
1095 xdate.month(date.mdy(6,19,1768) + time.hms(12,47,53)) => 6.00
1096 xdate.month(date.mdy(8,2,1819) + time.hms(1,26,0)) => 8.00
1097 xdate.month(date.mdy(3,27,1839) + time.hms(20,58,11)) => 3.00
1098 xdate.month(date.mdy(4,19,1903) + time.hms(7,36,5)) => 4.00
1099 xdate.month(date.mdy(8,25,1929) + time.hms(15,43,49)) => 8.00
1100 xdate.month(date.mdy(9,29,1941) + time.hms(4,25,9)) => 9.00
1101 xdate.month(date.mdy(4,19,1943) + time.hms(6,49,27)) => 4.00
1102 xdate.month(date.mdy(10,7,1943) + time.hms(2,57,52)) => 10.00
1103 xdate.month(date.mdy(3,17,1992) + time.hms(16,45,44)) => 3.00
1104 xdate.month(date.mdy(2,25,1996) + time.hms(21,30,57)) => 2.00
1105 xdate.month(date.mdy(9,29,41) + time.hms(4,25,9)) => 9.00
1106 xdate.month(date.mdy(4,19,43) + time.hms(6,49,27)) => 4.00
1107 xdate.month(date.mdy(10,7,43) + time.hms(2,57,52)) => 10.00
1108 xdate.month(date.mdy(3,17,92) + time.hms(16,45,44)) => 3.00
1109 xdate.month(date.mdy(2,25,96) + time.hms(21,30,57)) => 2.00
1110 xdate.month(date.mdy(11,10,2038) + time.hms(22,30,4)) => 11.00
1111 xdate.month(date.mdy(7,18,2094) + time.hms(1,56,51)) => 7.00
1112
1113 xdate.quarter(date.mdy(6,10,1648) + time.hms(0,0,0)) => 2.00
1114 xdate.quarter(date.mdy(6,30,1680) + time.hms(4,50,38)) => 2.00
1115 xdate.quarter(date.mdy(7,24,1716) + time.hms(12,31,35)) => 3.00
1116 xdate.quarter(date.mdy(6,19,1768) + time.hms(12,47,53)) => 2.00
1117 xdate.quarter(date.mdy(8,2,1819) + time.hms(1,26,0)) => 3.00
1118 xdate.quarter(date.mdy(3,27,1839) + time.hms(20,58,11)) => 1.00
1119 xdate.quarter(date.mdy(4,19,1903) + time.hms(7,36,5)) => 2.00
1120 xdate.quarter(date.mdy(8,25,1929) + time.hms(15,43,49)) => 3.00
1121 xdate.quarter(date.mdy(9,29,1941) + time.hms(4,25,9)) => 3.00
1122 xdate.quarter(date.mdy(4,19,1943) + time.hms(6,49,27)) => 2.00
1123 xdate.quarter(date.mdy(10,7,1943) + time.hms(2,57,52)) => 4.00
1124 xdate.quarter(date.mdy(3,17,1992) + time.hms(16,45,44)) => 1.00
1125 xdate.quarter(date.mdy(2,25,1996) + time.hms(21,30,57)) => 1.00
1126 xdate.quarter(date.mdy(9,29,41) + time.hms(4,25,9)) => 3.00
1127 xdate.quarter(date.mdy(4,19,43) + time.hms(6,49,27)) => 2.00
1128 xdate.quarter(date.mdy(10,7,43) + time.hms(2,57,52)) => 4.00
1129 xdate.quarter(date.mdy(3,17,92) + time.hms(16,45,44)) => 1.00
1130 xdate.quarter(date.mdy(2,25,96) + time.hms(21,30,57)) => 1.00
1131 xdate.quarter(date.mdy(11,10,2038) + time.hms(22,30,4)) => 4.00
1132 xdate.quarter(date.mdy(7,18,2094) + time.hms(1,56,51)) => 3.00
1133
1134 xdate.second(date.mdy(6,10,1648) + time.hms(0,0,0)) => 0.00
1135 xdate.second(date.mdy(6,30,1680) + time.hms(4,50,38)) => 38.00
1136 xdate.second(date.mdy(7,24,1716) + time.hms(12,31,35)) => 35.00
1137 xdate.second(date.mdy(6,19,1768) + time.hms(12,47,53)) => 53.00
1138 xdate.second(date.mdy(8,2,1819) + time.hms(1,26,0)) => 0.00
1139 xdate.second(date.mdy(3,27,1839) + time.hms(20,58,11)) => 11.00
1140 xdate.second(date.mdy(4,19,1903) + time.hms(7,36,5)) => 5.00
1141 xdate.second(date.mdy(8,25,1929) + time.hms(15,43,49)) => 49.00
1142 xdate.second(date.mdy(9,29,1941) + time.hms(4,25,9)) => 9.00
1143 xdate.second(date.mdy(4,19,1943) + time.hms(6,49,27)) => 27.00
1144 xdate.second(date.mdy(10,7,1943) + time.hms(2,57,52)) => 52.00
1145 xdate.second(date.mdy(3,17,1992) + time.hms(16,45,44)) => 44.00
1146 xdate.second(date.mdy(2,25,1996) + time.hms(21,30,57)) => 57.00
1147 xdate.second(date.mdy(9,29,41) + time.hms(4,25,9)) => 9.00
1148 xdate.second(date.mdy(4,19,43) + time.hms(6,49,27)) => 27.00
1149 xdate.second(date.mdy(10,7,43) + time.hms(2,57,52)) => 52.00
1150 xdate.second(date.mdy(3,17,92) + time.hms(16,45,44)) => 44.00
1151 xdate.second(date.mdy(2,25,96) + time.hms(21,30,57)) => 57.00
1152 xdate.second(date.mdy(11,10,2038) + time.hms(22,30,4)) => 4.00
1153 xdate.second(date.mdy(7,18,2094) + time.hms(1,56,51)) => 51.00
1154
1155 xdate.tday(date.mdy(6,10,1648) + time.hms(0,0,0)) => 23981.00
1156 xdate.tday(date.mdy(6,30,1680) + time.hms(4,50,38)) => 35689.00
1157 xdate.tday(date.mdy(7,24,1716) + time.hms(12,31,35)) => 48861.00
1158 xdate.tday(date.mdy(6,19,1768) + time.hms(12,47,53)) => 67819.00
1159 xdate.tday(date.mdy(8,2,1819) + time.hms(1,26,0)) => 86489.00
1160 xdate.tday(date.mdy(3,27,1839) + time.hms(20,58,11)) => 93666.00
1161 xdate.tday(date.mdy(4,19,1903) + time.hms(7,36,5)) => 117064.00
1162 xdate.tday(date.mdy(8,25,1929) + time.hms(15,43,49)) => 126689.00
1163 xdate.tday(date.mdy(9,29,1941) + time.hms(4,25,9)) => 131107.00
1164 xdate.tday(date.mdy(4,19,1943) + time.hms(6,49,27)) => 131674.00
1165 xdate.tday(date.mdy(10,7,1943) + time.hms(2,57,52)) => 131845.00
1166 xdate.tday(date.mdy(3,17,1992) + time.hms(16,45,44)) => 149539.00
1167 xdate.tday(date.mdy(2,25,1996) + time.hms(21,30,57)) => 150979.00
1168 xdate.tday(date.mdy(9,29,41) + time.hms(4,25,9)) => 131107.00
1169 xdate.tday(date.mdy(4,19,43) + time.hms(6,49,27)) => 131674.00
1170 xdate.tday(date.mdy(10,7,43) + time.hms(2,57,52)) => 131845.00
1171 xdate.tday(date.mdy(3,17,92) + time.hms(16,45,44)) => 149539.00
1172 xdate.tday(date.mdy(2,25,96) + time.hms(21,30,57)) => 150979.00
1173 xdate.tday(date.mdy(11,10,2038) + time.hms(22,30,4)) => 166578.00
1174 xdate.tday(date.mdy(7,18,2094) + time.hms(1,56,51)) => 186917.00
1175
1176 xdate.time(date.mdy(6,10,1648) + time.hms(0,0,0)) => 0.00
1177 xdate.time(date.mdy(6,30,1680) + time.hms(4,50,38)) => 17438.00
1178 xdate.time(date.mdy(7,24,1716) + time.hms(12,31,35)) => 45095.00
1179 xdate.time(date.mdy(6,19,1768) + time.hms(12,47,53)) => 46073.00
1180 xdate.time(date.mdy(8,2,1819) + time.hms(1,26,0)) => 5160.00
1181 xdate.time(date.mdy(3,27,1839) + time.hms(20,58,11)) => 75491.00
1182 xdate.time(date.mdy(4,19,1903) + time.hms(7,36,5)) => 27365.00
1183 xdate.time(date.mdy(8,25,1929) + time.hms(15,43,49)) => 56629.00
1184 xdate.time(date.mdy(9,29,1941) + time.hms(4,25,9)) => 15909.00
1185 xdate.time(date.mdy(4,19,1943) + time.hms(6,49,27)) => 24567.00
1186 xdate.time(date.mdy(10,7,1943) + time.hms(2,57,52)) => 10672.00
1187 xdate.time(date.mdy(3,17,1992) + time.hms(16,45,44)) => 60344.00
1188 xdate.time(date.mdy(2,25,1996) + time.hms(21,30,57)) => 77457.00
1189 xdate.time(date.mdy(9,29,41) + time.hms(4,25,9)) => 15909.00
1190 xdate.time(date.mdy(4,19,43) + time.hms(6,49,27)) => 24567.00
1191 xdate.time(date.mdy(10,7,43) + time.hms(2,57,52)) => 10672.00
1192 xdate.time(date.mdy(3,17,92) + time.hms(16,45,44)) => 60344.00
1193 xdate.time(date.mdy(2,25,96) + time.hms(21,30,57)) => 77457.00
1194 xdate.time(date.mdy(11,10,2038) + time.hms(22,30,4)) => 81004.00
1195 xdate.time(date.mdy(7,18,2094) + time.hms(1,56,51)) => 7011.00
1196
1197 xdate.week(date.mdy(6,10,1648) + time.hms(0,0,0)) => 24.00
1198 xdate.week(date.mdy(6,30,1680) + time.hms(4,50,38)) => 26.00
1199 xdate.week(date.mdy(7,24,1716) + time.hms(12,31,35)) => 30.00
1200 xdate.week(date.mdy(6,19,1768) + time.hms(12,47,53)) => 25.00
1201 xdate.week(date.mdy(8,2,1819) + time.hms(1,26,0)) => 31.00
1202 xdate.week(date.mdy(3,27,1839) + time.hms(20,58,11)) => 13.00
1203 xdate.week(date.mdy(4,19,1903) + time.hms(7,36,5)) => 16.00
1204 xdate.week(date.mdy(8,25,1929) + time.hms(15,43,49)) => 34.00
1205 xdate.week(date.mdy(9,29,1941) + time.hms(4,25,9)) => 39.00
1206 xdate.week(date.mdy(4,19,1943) + time.hms(6,49,27)) => 16.00
1207 xdate.week(date.mdy(10,7,1943) + time.hms(2,57,52)) => 40.00
1208 xdate.week(date.mdy(3,17,1992) + time.hms(16,45,44)) => 11.00
1209 xdate.week(date.mdy(2,25,1996) + time.hms(21,30,57)) => 8.00
1210 xdate.week(date.mdy(9,29,41) + time.hms(4,25,9)) => 39.00
1211 xdate.week(date.mdy(4,19,43) + time.hms(6,49,27)) => 16.00
1212 xdate.week(date.mdy(10,7,43) + time.hms(2,57,52)) => 40.00
1213 xdate.week(date.mdy(3,17,92) + time.hms(16,45,44)) => 11.00
1214 xdate.week(date.mdy(2,25,96) + time.hms(21,30,57)) => 8.00
1215 xdate.week(date.mdy(11,10,2038) + time.hms(22,30,4)) => 45.00
1216 xdate.week(date.mdy(7,18,2094) + time.hms(1,56,51)) => 29.00
1217
1218 xdate.wkday(date.mdy(6,10,1648)) => 4.00
1219 xdate.wkday(date.mdy(6,30,1680)) => 1.00
1220 xdate.wkday(date.mdy(7,24,1716)) => 6.00
1221 xdate.wkday(date.mdy(6,19,1768)) => 1.00
1222 xdate.wkday(date.mdy(8,2,1819)) => 2.00
1223 xdate.wkday(date.mdy(3,27,1839)) => 4.00
1224 xdate.wkday(date.mdy(4,19,1903)) => 1.00
1225 xdate.wkday(date.mdy(8,25,1929)) => 1.00
1226 xdate.wkday(date.mdy(9,29,1941)) => 2.00
1227 xdate.wkday(date.mdy(4,19,1943)) => 2.00
1228 xdate.wkday(date.mdy(10,7,1943)) => 5.00
1229 xdate.wkday(date.mdy(3,17,1992)) => 3.00
1230 xdate.wkday(date.mdy(2,25,1996)) => 1.00
1231 xdate.wkday(date.mdy(9,29,41)) => 2.00
1232 xdate.wkday(date.mdy(4,19,43)) => 2.00
1233 xdate.wkday(date.mdy(10,7,43)) => 5.00
1234 xdate.wkday(date.mdy(3,17,92)) => 3.00
1235 xdate.wkday(date.mdy(2,25,96)) => 1.00
1236 xdate.wkday(date.mdy(11,10,2038)) => 4.00
1237 xdate.wkday(date.mdy(7,18,2094)) => 1.00
1238
1239 xdate.year(date.mdy(6,10,1648) + time.hms(0,0,0)) => 1648.00
1240 xdate.year(date.mdy(6,30,1680) + time.hms(4,50,38)) => 1680.00
1241 xdate.year(date.mdy(7,24,1716) + time.hms(12,31,35)) => 1716.00
1242 xdate.year(date.mdy(6,19,1768) + time.hms(12,47,53)) => 1768.00
1243 xdate.year(date.mdy(8,2,1819) + time.hms(1,26,0)) => 1819.00
1244 xdate.year(date.mdy(3,27,1839) + time.hms(20,58,11)) => 1839.00
1245 xdate.year(date.mdy(4,19,1903) + time.hms(7,36,5)) => 1903.00
1246 xdate.year(date.mdy(8,25,1929) + time.hms(15,43,49)) => 1929.00
1247 xdate.year(date.mdy(9,29,1941) + time.hms(4,25,9)) => 1941.00
1248 xdate.year(date.mdy(4,19,1943) + time.hms(6,49,27)) => 1943.00
1249 xdate.year(date.mdy(10,7,1943) + time.hms(2,57,52)) => 1943.00
1250 xdate.year(date.mdy(3,17,1992) + time.hms(16,45,44)) => 1992.00
1251 xdate.year(date.mdy(2,25,1996) + time.hms(21,30,57)) => 1996.00
1252 xdate.year(date.mdy(9,29,41) + time.hms(4,25,9)) => 1941.00
1253 xdate.year(date.mdy(4,19,43) + time.hms(6,49,27)) => 1943.00
1254 xdate.year(date.mdy(10,7,43) + time.hms(2,57,52)) => 1943.00
1255 xdate.year(date.mdy(3,17,92) + time.hms(16,45,44)) => 1992.00
1256 xdate.year(date.mdy(2,25,96) + time.hms(21,30,57)) => 1996.00
1257 xdate.year(date.mdy(11,10,2038) + time.hms(22,30,4)) => 2038.00
1258 xdate.year(date.mdy(7,18,2094) + time.hms(1,56,51)) => 2094.00
1259
1260 # These test values are from Applied Statistics, Algorithm AS 310.
1261 1000 * ncdf.beta(.868,10,20,150) => 937.66
1262 1000 * ncdf.beta(.9,10,10,120) => 730.68
1263 1000 * ncdf.beta(.88,15,5,80) => 160.43
1264 1000 * ncdf.beta(.85,20,10,110) => 186.75
1265 1000 * ncdf.beta(.66,20,30,65) => 655.94
1266 1000 * ncdf.beta(.72,20,50,130) => 979.69
1267 1000 * ncdf.beta(.72,30,20,80) => 116.24
1268 1000 * ncdf.beta(.8,30,40,130) => 993.04
1269
1270 # FIXME: LAG
1271
1272 (X = 1.00); X => 1.00
1273 SYSMIS(1) => false
1274 SYSMIS($SYSMIS) => true
1275 SYSMIS(1 + $SYSMIS) => true
1276
1277 # FIXME: out-of-range and nearly out-of-range values on dates
1278
1279 # Tests correctness of generic optimizations in optimize_tree().
1280 (X = 10.00); x + 0 => 10.00
1281 (X = -3.00); x - 0 => -3.00
1282 (X = 5.00); 0 + x => 5.00
1283 (X = 10.00); x * 1 => 10.00
1284 (X = -3.00); 1 * x => -3.00
1285 (X = 5.00); x / 1 => 5.00
1286 (X = 10.00); 0 * x => 0.00
1287 (X = -3.00); x * 0 => 0.00
1288 (X = 5.00); 0 / x => 0.00
1289 (X = 5.00); mod(0, x) => 0.00
1290 (X = 5.00); x ** 1 => 5.00
1291 (X = 5.00); x ** 2 => 25.00
1292 EOF
1293 if [ $? -ne 0 ] ; then no_result ; fi
1294
1295 activity="create optimizing input"
1296 echo 'set mxwarn 1000.
1297 set mxerr 1000.' > $TEMPDIR/expr-opt.stat
1298 sed < $TEMPDIR/expr-list >> $TEMPDIR/expr-opt.stat \
1299         -e 's#^\(\(.*\); \)*\(.*\) => .*$#DEBUG EVALUATE\2/\3.#'
1300 if [ $? -ne 0 ] ; then no_result ; fi
1301
1302 activity="run optimizing program"
1303 $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii \
1304          $TEMPDIR/expr-opt.stat >$TEMPDIR/expr-opt.err 2> $TEMPDIR/expr-opt.out
1305
1306 activity="compare optimizing output"
1307 perl -pi -e 's/^\s*$//g' $TEMPDIR/expr-list $TEMPDIR/expr-opt.out
1308 diff -b $TEMPDIR/expr-list $TEMPDIR/expr-opt.out
1309 if [ $? -ne 0 ] ; then fail ; fi
1310
1311 activity="create non-optimizing input"
1312 echo 'set mxwarn 1000.
1313 set mxerr 1000.' > $TEMPDIR/expr-noopt.stat
1314 sed < $TEMPDIR/expr-list >> $TEMPDIR/expr-noopt.stat \
1315         -e 's#^\(\(.*\); \)*\(.*\) => .*$#DEBUG EVALUATE NOOPTIMIZE\2/\3.#'
1316 if [ $? -ne 0 ] ; then no_result ; fi
1317
1318 activity="run non-optimizing program"
1319 $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii \
1320         $TEMPDIR/expr-noopt.stat >$TEMPDIR/expr-noopt.err 2> $TEMPDIR/expr-noopt.out
1321
1322 activity="compare non-optimizing output"
1323 perl -pi -e 's/^\s*$//g' $TEMPDIR/expr-list $TEMPDIR/expr-noopt.out
1324 diff -b $TEMPDIR/expr-list $TEMPDIR/expr-noopt.out
1325 if [ $? -ne 0 ] ; then fail ; fi
1326
1327 activity="create optimizing postfix input"
1328 echo 'set mxwarn 1000.
1329 set mxerr 1000.' > $TEMPDIR/expr-opt-pos.stat
1330 sed < $TEMPDIR/expr-list >> $TEMPDIR/expr-opt-pos.stat \
1331         -e 's#^\(\(.*\); \)*\(.*\) => .*$#DEBUG EVALUATE POSTFIX\2/\3.#'
1332 if [ $? -ne 0 ] ; then no_result ; fi
1333
1334 activity="run optimizing postfix program"
1335 $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii \
1336          $TEMPDIR/expr-opt-pos.stat >$TEMPDIR/expr-opt-pos.err 2> $TEMPDIR/expr-opt-pos.out
1337 if [ $? -eq 0 ] ; then no_result ; fi
1338
1339 activity="create non-optimizing postfix input"
1340 echo 'set mxwarn 1000.
1341 set mxerr 1000.' > $TEMPDIR/expr-noopt-pos.stat
1342 sed < $TEMPDIR/expr-list >> $TEMPDIR/expr-noopt-pos.stat \
1343         -e 's#^\(\(.*\); \)*\(.*\) => .*$#DEBUG EVALUATE NOOPTIMIZE POSTFIX\2/\3.#'
1344 if [ $? -ne 0 ] ; then no_result ; fi
1345
1346 activity="run non-optimizing postfix program"
1347 $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii \
1348         $TEMPDIR/expr-noopt-pos.stat >$TEMPDIR/expr-noopt-pos.err 2> $TEMPDIR/expr-noopt-pos.out
1349 if [ $? -eq 0 ] ; then no_result ; fi
1350
1351 pass