xref: /openbsd-src/gnu/usr.bin/perl/os2/OS2/OS2-REXX/t/rx_tieydb.t (revision b39c515898423c8d899e35282f4b395f7cad3298)
1*b39c5158SmillertBEGIN {
2*b39c5158Smillert    chdir 't' if -d 't/lib';
3*b39c5158Smillert    @INC = '../lib' if -d 'lib';
4*b39c5158Smillert    require Config; import Config;
5*b39c5158Smillert    if (-d 'lib' and $Config{'extensions'} !~ /\bOS2(::|\/)REXX\b/) {
6*b39c5158Smillert	print "1..0\n";
7*b39c5158Smillert	exit 0;
8*b39c5158Smillert    }
9*b39c5158Smillert}
10*b39c5158Smillert
11*b39c5158Smillertuse OS2::REXX;
12*b39c5158Smillert$rx = load OS2::REXX "RXU"     # from RXU1a.ZIP
13*b39c5158Smillert  or print "1..0 # skipped: cannot find RXU.DLL\n" and exit;
14*b39c5158Smillert
15*b39c5158Smillertprint "1..7\n", "ok 1\n";
16*b39c5158Smillert
17*b39c5158Smillert$rx->prefix("Rx");                         # implicit function prefix
18*b39c5158Smillertprint "ok 2\n";
19*b39c5158Smillert
20*b39c5158SmillertREXX_call {
21*b39c5158Smillert  tie @pib, OS2::REXX, "IB.P";       # bind array to REXX stem variable
22*b39c5158Smillert  print "ok 3\n";
23*b39c5158Smillert  tie %tib, OS2::REXX, "IB.T.";      # bind associative array to REXX stem var
24*b39c5158Smillert  print "ok 4\n";
25*b39c5158Smillert
26*b39c5158Smillert  $rx->GetInfoBlocks("IB.");    # call REXX function
27*b39c5158Smillert  print "ok 5\n";
28*b39c5158Smillert  defined $pib[6] ? print "ok 6\n" : print "not ok 6\n# pib\n";
29*b39c5158Smillert  defined $tib{7} && $tib{7} =~ /^\d+$/ ? print "ok 7\n"
30*b39c5158Smillert    : print "not ok 7\n# tib\n";
31*b39c5158Smillert  print "# Process status is ", unpack("I", $pib[6]),
32*b39c5158Smillert        ", thread ordinal is $tib{7}\n";
33*b39c5158Smillert};
34