diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 2002-02-14 22:56:24 -0500 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2002-02-15 08:42:55 +0000 |
commit | 30500b05e0cd7c98f3f3ddb34d343729aab7b8f7 (patch) | |
tree | 6a93990dc0eba6e0f24b71fc429956915e61ea5f /os2/os2_base.t | |
parent | 59ecbafad1ed6a69b6ea56aa837f49504fd5051a (diff) | |
download | perl-30500b05e0cd7c98f3f3ddb34d343729aab7b8f7.tar.gz |
OS/2 tests and more
Message-Id: <20020215035624.A16467@math.ohio-state.edu>
p4raw-link: @14577 on //depot/perl: 0ad5258ff3f3328f321188cbb4fcd6a74b365431
p4raw-id: //depot/perl@14705
Diffstat (limited to 'os2/os2_base.t')
-rw-r--r-- | os2/os2_base.t | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/os2/os2_base.t b/os2/os2_base.t index ceaeb3f9eb..bb4735a96e 100644 --- a/os2/os2_base.t +++ b/os2/os2_base.t @@ -1,3 +1,53 @@ +#!/usr/bin/perl -w +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +use Test::More tests => 24; +use strict; +use Config; + +my $cwd = Cwd::sys_cwd(); +ok 1; +ok -d $cwd; + +my $lpb = Cwd::extLibpath; +ok 1; +$lpb .= ';' unless $lpb and $lpb =~ /;$/; + +my $lpe = Cwd::extLibpath(1); +ok 1; +$lpe .= ';' unless $lpe and $lpe =~ /;$/; + +ok Cwd::extLibpath_set("$lpb$cwd"); + +$lpb = Cwd::extLibpath; +ok 1; +$lpb =~ s#\\#/#g; +(my $s_cwd = $cwd) =~ s#\\#/#g; + +like($lpb, qr/\Q$s_cwd/); + +ok Cwd::extLibpath_set("$lpe$cwd", 1); + +$lpe = Cwd::extLibpath(1); +ok 1; +$lpe =~ s#\\#/#g; + +like($lpe, qr/\Q$s_cwd/); + +is(uc OS2::DLLname(1), uc $Config{dll_name}); +like(OS2::DLLname, qr#\Q/$Config{dll_name}\E\.dll$#i ); +(my $root_cwd = $s_cwd) =~ s,/t$,,; +like(OS2::DLLname, qr#^\Q$root_cwd\E(/t)?\Q/$Config{dll_name}\E\.dll#i ); +is(OS2::DLLname, OS2::DLLname(2)); +like(OS2::DLLname(0), qr#^(\d+)$# ); + + +is(OS2::DLLname($_), OS2::DLLname($_, \&Cwd::extLibpath) ) for 0..2; +ok(not defined eval { OS2::DLLname $_, \&Cwd::cwd; 1 } ) for 0..2; +ok(not defined eval { OS2::DLLname $_, \&xxx; 1 } ) for 0..2; print "1.." . lasttest() . "\n"; $cwd = Cwd::sys_cwd(); @@ -36,7 +86,7 @@ print "ok 10\n"; unshift @INC, 'lib'; require OS2::Process; -@l = OS2::Process::process_entry(); +my @l = OS2::Process::process_entry(); print "not " unless @l == 11; print "ok 11\n"; |