2 chdir 't' if -d 't/lib';
3 @INC = '../lib' if -d 'lib';
4 require Config; import Config;
5 if (-d 'lib' and $Config{'extensions'} !~ /\bOS2(::|\/)REXX\b/) {
11 # Before `make install' is performed this script should be runnable with
12 # `make test'. After `make install' it should work as `perl test.pl'
14 ######################### We start with some black magic to print on failure.
16 # Change 1..1 below to 1..last_test_to_print .
17 # (It may become useful if the test is moved to ./t subdirectory.)
19 BEGIN { $| = 1; print "1..21\n"; }
20 END {print "not ok 1\n" unless $loaded;}
25 ######################### End of black magic.
27 # Insert your test code below (better if it prints "ok 13"
28 # (correspondingly "not ok 13") depending on the success of chunk 13
31 unlink 't.out' if -f 't.out';
32 system 'cmd', '/c', 'echo OK > t.out';
36 tie %a, 'OS2::ExtAttr', 't.out';
39 keys %a == 0 ? print "ok 3\n" : print "not ok 3\n";
40 # Standard Extended Attributes (SEAs) have a dot (.) as a prefix.
41 # This identifies the extended attribute as a SEA. The leading dot is reserved,
42 # so applications should not define extended attributes that start with a dot.
43 # Also, extended attributes
44 # that start with the characters $, @, &, or + are reserved for system use.
45 $a{'X--Y'} = '---'; # '++', -++', '!++', 'X++Y' fail on JFS
47 $a{'AAA'} = 'xyz'; # Name is going to be uppercased???
53 tie %a, 'OS2::ExtAttr', 't.out';
57 $c == 2 ? print "ok 7\n" : print "not ok 7\n# c=$c\n";
59 "@b" eq 'AAA X--Y' ? print "ok 8\n" : print "not ok 8\n# keys=`@b'\n";
60 $a{'X--Y'} eq '---' ? print "ok 9\n" : print "not ok 9\n";;
61 $a{'AAA'} eq 'xyz' ? print "ok 10\n" : print "not ok 10\n# aaa->`$a{AAA}'\n";
62 $c = delete $a{'X--Y'};
63 $c eq '---' ? print "ok 11\n" : print "not ok 11\n# deleted->`$c'\n";;
70 tie %a, 'OS2::ExtAttr', 't.out';
73 keys %a == 1 ? print "ok 14\n" : print "not ok 14\n";
75 "@b" eq 'AAA' ? print "ok 15\n" : print "not ok 15\n";
76 $a{'AAA'} eq 'xyz' ? print "ok 16\n" : print "not ok 16\n";;
77 ! exists $a{'+'} ? print "ok 17\n" : print "not ok 17\n";;
78 ! defined $a{'+'} ? print "ok 18\n" : print "not ok 18\n# ->`$a{'X--Y'}'\n";;
79 ! exists $a{'X--Y'} ? print "ok 19\n" : print "not ok 19\n";;
80 ! defined $a{'X--Y'} ? print "ok 20\n" : print "not ok 20\n# ->`$a{'X--Y'}'\n";;