I don't think trying to bracket the hires time with lores
[p5sagit/p5-mst-13.2.git] / lib / Shell.t
CommitLineData
e66df073 1#!./perl
2
3use Test::More tests => 4;
4
5BEGIN { use_ok('Shell'); }
6
7my $Is_VMS = $^O eq 'VMS';
8my $Is_MSWin32 = $^O eq 'MSWin32';
9my $Is_NetWare = $^O eq 'NetWare';
10
11$Shell::capture_stderr = 1; #
12
13# Now test that that works ..
14
15my $tmpfile = 'sht0001';
16
17while ( -f $tmpfile )
18{
19 $tmpfile++;
20}
21
22END { -f $tmpfile && unlink $tmpfile };
23
24
25
26open(SAVERR,">&STDERR") ;
27open(STDERR, ">$tmpfile");
28
29xXx(); # Ok someone could have a program called this :(
30
31ok( !(-s $tmpfile) ,'$Shell::capture_stderr');
32
33$Shell::capture_stderr = 0; #
34
35# someone will have to fill in the blanks for other platforms
36
37if ( $Is_VMS )
38{
72c157b0 39 ok(directory(),'Execute command');
40 my @files = directory('*.*');
41 ok(@files,'Quoted arguments');
e66df073 42}
43elsif( $Is_MSWin32 )
44{
45 ok(dir(),'Execute command');
46
47 my @files = dir('*.*');
48
49 ok(@files, 'Quoted arguments');
50}
51else
52{
53 ok(ls(),'Execute command');
54
55 my @files = ls('*');
56
57 ok(@files,'Quoted arguments');
58
59}
9fb80172 60open(STDERR,">&SAVERR") ;