This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PREREQ_PM does not really require.
[perl5.git] / lib / Shell.t
CommitLineData
e66df073
JS
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{
39 skip "Please implement VMS test", 2;
40 ok(1);
41 ok(1);
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}