summaryrefslogtreecommitdiff
path: root/lib/Shell.t
blob: 5ff0b16087efa914fb0b343237f464919608b0ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!./perl

use Test::More tests => 4;

BEGIN { use_ok('Shell'); }

my $Is_VMS     = $^O eq 'VMS';
my $Is_MSWin32 = $^O eq 'MSWin32';
my $Is_NetWare = $^O eq 'NetWare';

$Shell::capture_stderr = 1; #

# Now test that that works ..

my $tmpfile = 'sht0001';

while ( -f $tmpfile )
{
  $tmpfile++;
}

END { -f $tmpfile && unlink $tmpfile };



open(SAVERR,">&STDERR") ;
open(STDERR, ">$tmpfile");

xXx();  # Ok someone could have a program called this :(

ok( !(-s $tmpfile) ,'$Shell::capture_stderr');

$Shell::capture_stderr = 0; #

# someone will have to fill in the blanks for other platforms

if ( $Is_VMS )
{
   skip "Please implement VMS test", 2;
   ok(1);
   ok(1);
}
elsif( $Is_MSWin32 )
{
  ok(dir(),'Execute command');

  my @files = dir('*.*');

  ok(@files, 'Quoted arguments');
}
else
{
  ok(ls(),'Execute command');

  my @files = ls('*');

  ok(@files,'Quoted arguments');

}