summaryrefslogtreecommitdiff
path: root/t/lib
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-11-30 20:31:59 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-11-30 20:31:59 +0000
commite4fc8a1e010cc9cb02abe6e5d8d39a15decdcd55 (patch)
tree5876db4ca716cddd7393b89cb6fbf3964e5e2055 /t/lib
parent767bb2e0924772d5c7f107cbef61877d1bc39810 (diff)
downloadperl-e4fc8a1e010cc9cb02abe6e5d8d39a15decdcd55.tar.gz
Upgrade to Test::Harness 2.38.
Introduce the prove(1) utility. (The prove-switches test is disabled for now.) p4raw-id: //depot/perl@21826
Diffstat (limited to 't/lib')
-rw-r--r--t/lib/Dev/Null.pm17
-rw-r--r--t/lib/sample-tests/inc_taint7
-rw-r--r--t/lib/sample-tests/taint_warn11
3 files changed, 35 insertions, 0 deletions
diff --git a/t/lib/Dev/Null.pm b/t/lib/Dev/Null.pm
new file mode 100644
index 0000000000..2bd2274061
--- /dev/null
+++ b/t/lib/Dev/Null.pm
@@ -0,0 +1,17 @@
+# For shutting up Test::Harness.
+# Has to work on 5.004 which doesn't have Tie::StdHandle.
+package Dev::Null;
+
+sub WRITE {}
+sub PRINT {}
+sub PRINTF {}
+sub TIEHANDLE {
+ my $class = shift;
+ my $fh = do { local *HANDLE; \*HANDLE };
+ return bless $fh, $class;
+}
+sub READ {}
+sub READLINE {}
+sub GETC {}
+
+1;
diff --git a/t/lib/sample-tests/inc_taint b/t/lib/sample-tests/inc_taint
new file mode 100644
index 0000000000..c0dc994989
--- /dev/null
+++ b/t/lib/sample-tests/inc_taint
@@ -0,0 +1,7 @@
+#!/usr/bin/perl -Tw
+
+use lib qw(t/lib);
+use Test::More tests => 1;
+
+ok( grep(/we_added_this_lib/, @INC) );
+
diff --git a/t/lib/sample-tests/taint_warn b/t/lib/sample-tests/taint_warn
new file mode 100644
index 0000000000..5b4c486166
--- /dev/null
+++ b/t/lib/sample-tests/taint_warn
@@ -0,0 +1,11 @@
+#!/usr/bin/perl -tw
+
+use lib qw(t/lib);
+use Test::More tests => 1;
+
+my $warnings = '';
+{
+ local $SIG{__WARN__} = sub { $warnings .= join '', @_ };
+ kill 0, $^X;
+}
+like( $warnings, '/^Insecure dependency/', '-t honored' );