8 use Test::More tests => 7;
10 BEGIN { use_ok('Shell'); }
13 ok($so, 'Shell->new');
15 my $Is_VMS = $^O eq 'VMS';
16 my $Is_MSWin32 = $^O eq 'MSWin32';
17 my $Is_NetWare = $^O eq 'NetWare';
19 $Shell::capture_stderr = 1;
21 # Now test that that works ..
23 my $tmpfile = 'sht0001';
24 while ( -f $tmpfile ) {
27 END { -f $tmpfile && (open STDERR, '>&SAVERR' and unlink $tmpfile) }
30 open(SAVERR, ">&STDERR");
31 open(STDERR, ">$tmpfile");
33 xXx(); # Ok someone could have a program called this :(
35 # On os2 the warning is on by default...
36 ok(($^O eq 'os2' xor !(-s $tmpfile)), '$Shell::capture_stderr');
38 $Shell::capture_stderr = 0;
40 # someone will have to fill in the blanks for other platforms
43 ok(directory(), 'Execute command');
44 my @files = directory('*.*');
45 ok(@files, 'Quoted arguments');
47 ok(eq_array(\@files, [$so->directory('*.*')]), 'object method');
48 eval { $so->directory };
49 ok(!$@, '2 methods calls');
50 } elsif ($Is_MSWin32) {
51 ok(dir(), 'Execute command');
52 my @files = dir('*.*');
53 ok(@files, 'Quoted arguments');
55 ok(eq_array(\@files, [$so->dir('*.*')]), 'object method');
57 ok(!$@, '2 methods calls');
59 ok(ls(), 'Execute command');
61 ok(@files, 'Quoted arguments');
63 ok(eq_array(\@files, [$so->ls('*')]), 'object method');
65 ok(!$@, '2 methods calls');
68 open(STDERR, ">&SAVERR") ;