This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: The hitlist of untested modules.
authorJonathan Stowe <gellyfish@gellyfish.com>
Wed, 29 Aug 2001 09:25:49 +0000 (10:25 +0100)
committerArtur Bergman <sky@nanisky.com>
Wed, 29 Aug 2001 08:06:12 +0000 (08:06 +0000)
Message-ID: <Pine.LNX.4.33.0108290923320.29273-100000@orpheus.gellyfish.com>
Start of tests for Shell.pm (make Schwern poorer!)

p4raw-id: //depot/perl@11784

MANIFEST
lib/Shell.t [new file with mode: 0644]

index aec8de1..e82e0f3 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1084,6 +1084,7 @@ lib/SelectSaver.t         See if SelectSaver works
 lib/SelfLoader.pm              Load functions only on demand
 lib/SelfLoader.t               See if SelfLoader works
 lib/Shell.pm                   Make AUTOLOADed system() calls
+lib/Shell.t                    Tests for above
 lib/shellwords.pl              Perl library to split into words with shell quoting
 lib/sigtrap.pm                 For trapping an abort and giving traceback
 lib/stat.pl                    Perl library supporting stat function
diff --git a/lib/Shell.t b/lib/Shell.t
new file mode 100644 (file)
index 0000000..5ff0b16
--- /dev/null
@@ -0,0 +1,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');
+
+}