Automatically infer variables' measurement level from format and data.
[pspp] / tests / perl-module.at
1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017, 2020, 2021 Free Software Foundation, Inc.
3 dnl
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 dnl
17 AT_BANNER([Perl module tests])
18
19 m4_divert_push([PREPARE_TESTS])
20 # Find the Address Sanitizer library that PSPP is linked against, if any.
21 # If it exists, it needs to be preloaded when we run Perl.
22 asan_lib=$("$abs_top_builddir/libtool" --mode=execute ldd \
23                "$abs_top_builddir/src/ui/terminal/pspp" 2>/dev/null \
24            | grep asan \
25            | awk '{print $3}')
26 if test -e "$asan_lib"; then
27     USING_ASAN=:
28 else
29     USING_ASAN=false
30     asan_lib=
31 fi
32
33 dnl This command can be used to run with the PSPP Perl module after it has been
34 dnl built (with "make") but before it has been installed.  The -I options are
35 dnl equivalent to "use ExtUtils::testlib;" inside the Perl program, but it does
36 dnl not need to be run with the perl-module build directory as the current
37 dnl working directory.
38 run_perl_module () {
39     LD_PRELOAD="$asan_lib":"$LD_PRELOAD" \
40     LD_LIBRARY_PATH="$abs_top_builddir/src/.libs" \
41     DYLD_LIBRARY_PATH="$abs_top_builddir/src/.libs" \
42     ASAN_OPTIONS="$ASAN_OPTIONS detect_leaks=false" \
43     $PERL -I"$abs_top_builddir/perl-module/blib/arch" \
44           -I"$abs_top_builddir/perl-module/blib/lib" "$@"
45 }
46 m4_divert_pop([PREPARE_TESTS])
47
48 AT_SETUP([Perl create system file])
49 AT_SKIP_IF([test "$WITH_PERL_MODULE" = no])
50 AT_DATA([test.pl],
51   [use warnings;
52    use strict;
53    use PSPP;
54
55    my $d = PSPP::Dict->new();
56    die "dictionary creation" if !ref $d;
57    die if $d->get_var_cnt () != 0;
58
59    $d->set_label ("My Dictionary");
60    $d->set_documents ("These Documents");
61
62    # Tests for variable creation
63
64    my $var0 = PSPP::Var->new ($d, "le");
65    die "trap illegal variable name" if ref $var0;
66    die if $d->get_var_cnt () != 0;
67
68    $var0 = PSPP::Var->new ($d, "legal");
69    die "accept legal variable name" if !ref $var0;
70    die if $d->get_var_cnt () != 1;
71
72    my $var1 = PSPP::Var->new ($d, "money",
73                               (fmt=>PSPP::Fmt::DOLLAR,
74                                width=>4, decimals=>2) );
75    die "cappet valid format" if !ref $var1;
76    die if $d->get_var_cnt () != 2;
77
78    $d->set_weight ($var1);
79
80    my $sysfile = PSPP::Sysfile->new ('testfile.sav', $d);
81    die "create sysfile object" if !ref $sysfile;
82
83    $sysfile->close ();
84 ])
85 AT_CHECK([run_perl_module test.pl])
86 AT_DATA([dump-dict.sps],
87   [GET FILE='testfile.sav'.
88 DISPLAY FILE LABEL.
89 DISPLAY DOCUMENTS.
90 DISPLAY DICTIONARY.
91 SHOW WEIGHT.
92 ])
93 AT_CHECK([pspp -O format=csv dump-dict.sps], [0], [dnl
94 Table: File Label
95 Label,My Dictionary
96
97 Table: Documents
98 These Documents
99
100 Table: Variables
101 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
102 legal,1,Scale,Input,8,Right,F9.2,F9.2
103 money,2,Scale,Input,8,Right,DOLLAR6.2,DOLLAR6.2
104
105 dump-dict.sps:5: note: SHOW: WEIGHT is money.
106 ])
107 AT_CLEANUP
108
109 AT_SETUP([Perl writing cases to system files])
110 AT_SKIP_IF([test "$WITH_PERL_MODULE" = no])
111 AT_DATA([test.pl],
112   [[use warnings;
113     use strict;
114     use PSPP;
115
116     my $d = PSPP::Dict->new();
117     PSPP::Var->new ($d, "id",
118                     (
119                      fmt=>PSPP::Fmt::F,
120                      width=>2,
121                      decimals=>0
122                      )
123                     );
124
125     PSPP::Var->new ($d, "name",
126                            (
127                             fmt=>PSPP::Fmt::A,
128                             width=>20,
129                             )
130                            );
131
132     $d->set_documents ("This should not appear");
133     $d->clear_documents ();
134     $d->add_document ("This is a document line");
135
136     $d->set_label ("This is the file label");
137
138     # Check that we can write cases to system files.
139     my $sysfile = PSPP::Sysfile->new ("testfile.sav", $d);
140     my $res = $sysfile->append_case ( [34, "frederick"]);
141     die "append case" if !$res;
142
143     $res = $sysfile->append_case ( [34, "frederick", "extra"]);
144     die "append case with too many variables" if $res;
145     $sysfile->close ();
146
147     # Check that sysfiles are closed properly automaticallly in the destructor.
148     my $sysfile2 = PSPP::Sysfile->new ("testfile2.sav", $d);
149     $res = $sysfile2->append_case ( [21, "wheelbarrow"]);
150     die "append case 2" if !$res;
151
152     $res = $sysfile->append_case ( [34, "frederick", "extra"]);
153     die "append case with too many variables" if $res;
154
155     # Don't close.  We want to test that the destructor does that.
156 ]])
157 AT_CHECK([run_perl_module test.pl])
158 AT_DATA([dump-dicts.sps],
159   [GET FILE='testfile.sav'.
160 DISPLAY DICTIONARY.
161 DISPLAY FILE LABEL.
162 DISPLAY DOCUMENTS.
163 LIST.
164
165 GET FILE='testfile2.sav'.
166 DISPLAY DICTIONARY.
167 DISPLAY FILE LABEL.
168 DISPLAY DOCUMENTS.
169 LIST.
170 ])
171 AT_CHECK([pspp -O format=csv dump-dicts.sps], [0], [dnl
172 Table: Variables
173 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
174 id,1,Scale,Input,8,Right,F2.0,F2.0
175 name,2,Nominal,Input,20,Left,A20,A20
176
177 Table: File Label
178 Label,This is the file label
179
180 Table: Documents
181 This is a document line
182
183 Table: Data List
184 id,name
185 34,frederick
186
187 Table: Variables
188 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
189 id,1,Scale,Input,8,Right,F2.0,F2.0
190 name,2,Nominal,Input,20,Left,A20,A20
191
192 Table: File Label
193 Label,This is the file label
194
195 Table: Documents
196 This is a document line
197
198 Table: Data List
199 id,name
200 21,wheelbarrow
201 ])
202 AT_CLEANUP
203
204 AT_SETUP([Perl write variable parameters])
205 AT_SKIP_IF([test "$WITH_PERL_MODULE" = no])
206 AT_DATA([test.pl],
207   [[use warnings;
208     use strict;
209     use PSPP;
210
211     my $dict = PSPP::Dict->new();
212     die "dictionary creation" if !ref $dict;
213
214     my $int = PSPP::Var->new ($dict, "integer",
215                               (width=>8, decimals=>0) );
216
217     $int->set_label ("My Integer");
218
219     $int->add_value_label (99, "Silly");
220     $int->clear_value_labels ();
221     $int->add_value_label (0, "Zero");
222     $int->add_value_label (1, "Unity");
223     $int->add_value_label (2, "Duality");
224
225     my $str = PSPP::Var->new ($dict, "string",
226                               (fmt=>PSPP::Fmt::A, width=>8) );
227
228
229     $str->set_label ("My String");
230     $str->add_value_label ("xx", "foo");
231     $str->add_value_label ("yy", "bar");
232
233     $str->set_missing_values ("this", "that");
234
235     my $longstr = PSPP::Var->new ($dict, "longstring",
236                               (fmt=>PSPP::Fmt::A, width=>9) );
237
238
239     $longstr->set_label ("My Long String");
240     my $re = $longstr->add_value_label ("xxx", "xfoo");
241
242     $int->set_missing_values (9, 99);
243
244     my $sysfile = PSPP::Sysfile->new ("testfile.sav", $dict);
245
246
247     $sysfile->close ();
248 ]])
249 AT_CHECK([run_perl_module test.pl], [0], [], [stderr])
250 cat stderr
251 AT_DATA([dump-dict.sps],
252   [GET FILE='testfile.sav'.
253 DISPLAY DICTIONARY.
254 ])
255 AT_CHECK([pspp -O format=csv dump-dict.sps], [0], [dnl
256 Table: Variables
257 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
258 integer,1,My Integer,Scale,Input,8,Right,F8.0,F8.0,9; 99
259 string,2,My String,Nominal,Input,8,Left,A8,A8,"""this    ""; ""that    """
260 longstring,3,My Long String,Nominal,Input,9,Left,A9,A9,
261
262 Table: Value Labels
263 Variable Value,,Label
264 My Integer,0,Zero
265 ,1,Unity
266 ,2,Duality
267 My String,xx,foo
268 ,yy,bar
269 My Long String,xxx,xfoo
270 ])
271 AT_CLEANUP
272
273 AT_SETUP([Perl dictionary survives system file])
274 AT_SKIP_IF([test "$WITH_PERL_MODULE" = no])
275 AT_DATA([test.pl],
276   [[use warnings;
277 use strict;
278 use PSPP;
279
280 my $sysfile ;
281
282     {
283         my $d = PSPP::Dict->new();
284
285         PSPP::Var->new ($d, "id",
286                         (
287                          fmt=>PSPP::Fmt::F,
288                          width=>2,
289                          decimals=>0
290                          )
291                         );
292
293         $sysfile = PSPP::Sysfile->new ("testfile.sav", $d);
294     }
295
296     my $res = $sysfile->append_case ([3]);
297     print "Dictionary survives sysfile\n" if $res;
298 ]])
299 AT_CHECK([run_perl_module test.pl], [0],
300   [Dictionary survives sysfile
301 ])
302 AT_CLEANUP
303
304 m4_define([PERL_GENERATE_SYSFILE],
305   [AT_DATA([sample.sps],
306     [[data list notable list /string (a8) longstring (a12) numeric (f10) date (date11) dollar (dollar8.2) datetime (datetime17)
307 begin data.
308 1111 One   1 1/1/1 1   1/1/1+01:01
309 2222 Two   2 2/2/2 2   2/2/2+02:02
310 3333 Three 3 3/3/3 3   3/3/3+03:03
311 .    .     . .     .   .
312 5555 Five  5 5/5/5 5   5/5/5+05:05
313 end data.
314
315
316 variable labels string 'A Short String Variable'
317   /longstring 'A Long String Variable'
318   /numeric 'A Numeric Variable'
319   /date 'A Date Variable'
320   /dollar 'A Dollar Variable'
321   /datetime 'A Datetime Variable'.
322
323
324 missing values numeric (9, 5, 999).
325
326 missing values string ("3333").
327
328 add value labels
329   /string '1111' 'ones' '2222' 'twos' '3333' 'threes'
330   /numeric 1 'Unity' 2 'Duality' 3 'Thripality'.
331
332 variable attribute
333     variables = numeric
334     attribute=colour[1]('blue') colour[2]('pink') colour[3]('violet')
335     attribute=size('large') nationality('foreign').
336
337
338 save outfile='sample.sav'.
339 ]])
340    AT_CHECK([pspp -O format=csv sample.sps])])
341
342 AT_SETUP([Perl read system file])
343 AT_SKIP_IF([test "$WITH_PERL_MODULE" = no])
344 PERL_GENERATE_SYSFILE
345 AT_DATA([test.pl],
346   [[use warnings;
347     use strict;
348     use PSPP;
349
350     my $sf = PSPP::Reader->open ("sample.sav");
351
352     my $dict = $sf->get_dict ();
353
354     for (my $v = 0 ; $v < $dict->get_var_cnt() ; $v++)
355     {
356        my $var = $dict->get_var ($v);
357        my $name = $var->get_name ();
358        my $label = $var->get_label ();
359
360        print "Variable $v is \"$name\", label is \"$label\"\n";
361
362        my $vl = $var->get_value_labels ();
363
364        print "Value Labels:\n";
365        print "$_ => $vl->{$_}\n" for sort (keys %$vl);
366     }
367
368     while (my @c = $sf->get_next_case () )
369     {
370        for (my $v = 0; $v < $dict->get_var_cnt(); $v++)
371        {
372            print "val$v: \"$c[$v]\"\n";
373        }
374        print "\n";
375     }
376 ]])
377 AT_CHECK([run_perl_module test.pl], [0],
378   [Variable 0 is "string", label is "A Short String Variable"
379 Value Labels:
380 1111     => ones
381 2222     => twos
382 3333     => threes
383 Variable 1 is "longstring", label is "A Long String Variable"
384 Value Labels:
385 Variable 2 is "numeric", label is "A Numeric Variable"
386 Value Labels:
387 1 => Unity
388 2 => Duality
389 3 => Thripality
390 Variable 3 is "date", label is "A Date Variable"
391 Value Labels:
392 Variable 4 is "dollar", label is "A Dollar Variable"
393 Value Labels:
394 Variable 5 is "datetime", label is "A Datetime Variable"
395 Value Labels:
396 val0: "1111    "
397 val1: "One         "
398 val2: "1"
399 val3: "13197686400"
400 val4: "1"
401 val5: "13197690060"
402
403 val0: "2222    "
404 val1: "Two         "
405 val2: "2"
406 val3: "13231987200"
407 val4: "2"
408 val5: "13231994520"
409
410 val0: "3333    "
411 val1: "Three       "
412 val2: "3"
413 val3: "13266028800"
414 val4: "3"
415 val5: "13266039780"
416
417 val0: ".       "
418 val1: ".           "
419 val2: ""
420 val3: ""
421 val4: ""
422 val5: ""
423
424 val0: "5555    "
425 val1: "Five        "
426 val2: "5"
427 val3: "13334630400"
428 val4: "5"
429 val5: "13334648700"
430
431 ])
432 AT_CLEANUP
433
434 AT_SETUP([Perl copying system files])
435 AT_SKIP_IF([test "$WITH_PERL_MODULE" = no])
436 PERL_GENERATE_SYSFILE
437 AT_DATA([test.pl],
438   [[use warnings;
439     use strict;
440     use PSPP;
441
442     my $input = PSPP::Reader->open ("sample.sav");
443
444     my $dict = $input->get_dict ();
445
446     my $output = PSPP::Sysfile->new ("copy.sav", $dict);
447
448     while (my (@c) = $input->get_next_case () )
449     {
450       $output->append_case (\@c);
451     }
452
453     $output->close ();
454 ]])
455 AT_CHECK([run_perl_module test.pl])
456 AT_DATA([dump-dicts.sps],
457   [GET FILE='sample.sav'.
458 DISPLAY DICTIONARY.
459 DISPLAY ATTRIBUTES
460 LIST.
461
462 GET FILE='copy.sav'.
463 DISPLAY DICTIONARY.
464 DISPLAY ATTRIBUTES
465 LIST.
466 ])
467 AT_CHECK([pspp -O format=csv dump-dicts.sps], [0],
468   [[Table: Variables
469 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
470 string,1,A Short String Variable,Nominal,Input,8,Left,A8,A8,"""3333    """
471 longstring,2,A Long String Variable,Nominal,Input,12,Left,A12,A12,
472 numeric,3,A Numeric Variable,Nominal,Input,8,Right,F10.0,F10.0,9; 5; 999
473 date,4,A Date Variable,Scale,Input,8,Right,DATE11,DATE11,
474 dollar,5,A Dollar Variable,Scale,Input,8,Right,DOLLAR11.2,DOLLAR11.2,
475 datetime,6,A Datetime Variable,Scale,Input,8,Right,DATETIME17.0,DATETIME17.0,
476
477 Table: Value Labels
478 Variable Value,,Label
479 A Short String Variable,1111,ones
480 ,2222,twos
481 ,3333[a],threes
482 A Numeric Variable,1,Unity
483 ,2,Duality
484 ,3,Thripality
485 Footnote: a. User-missing value
486
487 Table: Variable and Dataset Attributes
488 Variable and Name,,Value
489 A Numeric Variable,colour[1],blue
490 ,colour[2],pink
491 ,colour[3],violet
492 ,nationality,foreign
493 ,size,large
494
495 Table: Data List
496 string,longstring,numeric,date,dollar,datetime
497 1111,One,1,01-JAN-2001,$1.00,01-JAN-2001 01:01
498 2222,Two,2,02-FEB-2002,$2.00,02-FEB-2002 02:02
499 3333,Three,3,03-MAR-2003,$3.00,03-MAR-2003 03:03
500 .,.,.,.,.  ,.
501 5555,Five,5,05-MAY-2005,$5.00,05-MAY-2005 05:05
502
503 Table: Variables
504 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
505 string,1,A Short String Variable,Nominal,Input,8,Left,A8,A8,"""3333    """
506 longstring,2,A Long String Variable,Nominal,Input,12,Left,A12,A12,
507 numeric,3,A Numeric Variable,Nominal,Input,8,Right,F10.0,F10.0,9; 5; 999
508 date,4,A Date Variable,Scale,Input,8,Right,DATE11,DATE11,
509 dollar,5,A Dollar Variable,Scale,Input,8,Right,DOLLAR11.2,DOLLAR11.2,
510 datetime,6,A Datetime Variable,Scale,Input,8,Right,DATETIME17.0,DATETIME17.0,
511
512 Table: Value Labels
513 Variable Value,,Label
514 A Short String Variable,1111,ones
515 ,2222,twos
516 ,3333[a],threes
517 A Numeric Variable,1,Unity
518 ,2,Duality
519 ,3,Thripality
520 Footnote: a. User-missing value
521
522 Table: Variable and Dataset Attributes
523 Variable and Name,,Value
524 A Numeric Variable,colour[1],blue
525 ,colour[2],pink
526 ,colour[3],violet
527 ,nationality,foreign
528 ,size,large
529
530 Table: Data List
531 string,longstring,numeric,date,dollar,datetime
532 1111,One,1,01-JAN-2001,$1.00,01-JAN-2001 01:01
533 2222,Two,2,02-FEB-2002,$2.00,02-FEB-2002 02:02
534 3333,Three,3,03-MAR-2003,$3.00,03-MAR-2003 03:03
535 .,.,.,.,.  ,.
536 5555,Five,5,05-MAY-2005,$5.00,05-MAY-2005 05:05
537 ]])
538 AT_CLEANUP
539
540 AT_SETUP([Perl value formatting])
541 AT_SKIP_IF([test "$WITH_PERL_MODULE" = no])
542 AT_DATA([dd.sps],
543   [DATA LIST LIST /d (DATETIME17).
544 BEGIN DATA.
545 11/9/2001+08:20
546 END DATA.
547
548 SAVE OUTFILE='dd.sav'.
549 ])
550 AT_CHECK([pspp -O format=csv dd.sps], [0],
551   [Table: Reading free-form data from INLINE.
552 Variable,Format
553 d,DATETIME17.0
554 ])
555 AT_DATA([test.pl],
556   [[use warnings;
557     use strict;
558     use PSPP;
559
560     my $sf = PSPP::Reader->open ("dd.sav");
561
562     my $dict = $sf->get_dict ();
563
564     my (@c) = $sf->get_next_case ();
565
566     my $var = $dict->get_var (0);
567     my $val = $c[0];
568     my $formatted = PSPP::format_value ($val, $var);
569     my $str = gmtime ($val - PSPP::PERL_EPOCH);
570     print "Formatted string is \"$formatted\"\n";
571     print "Perl representation is \"$str\"\n";
572 ]])
573 AT_CHECK([run_perl_module test.pl], [0],
574   [[Formatted string is "11-SEP-2001 08:20"
575 Perl representation is "Tue Sep 11 08:20:00 2001"
576 ]])
577 AT_CLEANUP
578
579 AT_SETUP([Perl opening nonexistent file])
580 AT_SKIP_IF([test "$WITH_PERL_MODULE" = no])
581 AT_DATA([test.pl],
582   [[use warnings;
583     use strict;
584     use PSPP;
585
586     my $sf = PSPP::Reader->open ("no-such-file.sav");
587
588     die "Returns undef on opening failure" if ref $sf;
589     print $PSPP::errstr, "\n";
590 ]])
591 AT_CHECK([run_perl_module test.pl], [0],
592   [[An error occurred while opening `no-such-file.sav': No such file or directory.
593 ]],
594   [[Name "PSPP::errstr" used only once: possible typo at test.pl line 8.
595 ]])
596 AT_CLEANUP
597
598 AT_SETUP([Perl missing values])
599 AT_SKIP_IF([test "$WITH_PERL_MODULE" = no])
600 PERL_GENERATE_SYSFILE
601 AT_DATA([test.pl],
602   [[use warnings;
603     use strict;
604     use PSPP;
605
606     my $sf = PSPP::Reader->open ("sample.sav");
607
608     my $dict = $sf->get_dict ();
609
610     my (@c) = $sf->get_next_case ();
611
612     my $stringvar = $dict->get_var (0);
613     my $numericvar = $dict->get_var (2);
614     my $val = $c[0];
615
616     die "Missing Value Negative String"
617         if PSPP::value_is_missing ($val, $stringvar);
618
619     $val = $c[2];
620
621     die "Missing Value Negative Num"
622         if PSPP::value_is_missing ($val, $numericvar);
623
624     @c = $sf->get_next_case ();
625     @c = $sf->get_next_case ();
626
627     $val = $c[0];
628     die "Missing Value Positive"
629         if !PSPP::value_is_missing ($val, $stringvar);
630
631     @c = $sf->get_next_case ();
632     $val = $c[2];
633     die "Missing Value Positive SYS"
634         if !PSPP::value_is_missing ($val, $numericvar);
635
636     @c = $sf->get_next_case ();
637     $val = $c[2];
638     die "Missing Value Positive Num"
639         if !PSPP::value_is_missing ($val, $numericvar);
640 ]])
641 AT_CHECK([run_perl_module test.pl])
642 AT_CLEANUP
643
644 AT_SETUP([Perl custom attributes])
645 AT_SKIP_IF([test "$WITH_PERL_MODULE" = no])
646 PERL_GENERATE_SYSFILE
647 AT_DATA([test.pl],
648   [[use warnings;
649     use strict;
650     use PSPP;
651
652     my $sf = PSPP::Reader->open ("sample.sav");
653
654     my $dict = $sf->get_dict ();
655
656     my $var = $dict->get_var_by_name ("numeric");
657
658     my $attr = $var->get_attributes ();
659
660     foreach my $k (sort (keys (%$attr)))
661     {
662         my $ll = $attr->{$k};
663         print "$k =>";
664         print map "$_\n", join ', ', @$ll;
665     }
666 ]])
667 AT_CHECK([run_perl_module test.pl], [0],
668   [[$@Role =>0
669 colour =>blue, pink, violet
670 nationality =>foreign
671 size =>large
672 ]])
673 AT_CLEANUP
674
675 AT_SETUP([Perl Pspp.t])
676 AT_KEYWORDS([slow])
677 AT_SKIP_IF([test "$WITH_PERL_MODULE" = no])
678 # Skip this test if Perl's Text::Diff module is not installed.
679 AT_CHECK([perl -MText::Diff -e '' || exit 77])
680 AT_CHECK([run_perl_module "$abs_top_builddir/perl-module/t/Pspp.t"], [0],
681   [[1..37
682 ok 1 - use PSPP;
683 ok 2 - Dictionary Creation
684 ok 3
685 ok 4 - Trap illegal variable name
686 ok 5
687 ok 6 - Accept legal variable name
688 ok 7
689 ok 8 - Trap duplicate variable name
690 ok 9
691 ok 10 - Accept valid format
692 ok 11
693 ok 12 - Create sysfile object
694 ok 13 - Write system file
695 ok 14 - Append Case
696 ok 15 - Appending Case with too many variables
697 ok 16 - existance
698 ok 17 - Append Case 2
699 ok 18 - existance2
700 ok 19 - Check output
701 ok 20 - Dictionary Creation 2
702 ok 21 - Value label for short string
703 ok 22 - Value label for long string
704 ok 23 - Check output 2
705 ok 24 - Dictionary survives sysfile
706 ok 25 - Basic reader operation
707 ok 26 - Streaming of files
708 Formatted string is "11-SEP-2001 08:20"
709 ok 27 - format_value function
710 ok 28 - Perl representation of time
711 ok 29 - Returns undef on opening failure
712 ok 30 - Error string on open failure
713 ok 31 - Missing Value Negative String
714 ok 32 - Missing Value Negative Num
715 ok 33 - Missing Value Positive
716 ok 34 - Missing Value Positive SYS
717 ok 35 - Missing Value Positive Num
718 ok 36 - Custom Attributes
719 ok 37 - Case count
720 ]],[ignore])
721 AT_CLEANUP