[Bast-commits] r5879 - Devel-Declare/1.000/trunk/t
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Fri Apr 10 00:03:13 GMT 2009
Author: rafl
Date: 2009-04-10 01:03:12 +0100 (Fri, 10 Apr 2009)
New Revision: 5879
Modified:
Devel-Declare/1.000/trunk/t/quote.t
Log:
Updated t/quote.t to quash warnings and use cross-platform /dev/null
Modified: Devel-Declare/1.000/trunk/t/quote.t
===================================================================
--- Devel-Declare/1.000/trunk/t/quote.t 2009-04-09 21:55:20 UTC (rev 5878)
+++ Devel-Declare/1.000/trunk/t/quote.t 2009-04-10 00:03:12 UTC (rev 5879)
@@ -3,26 +3,39 @@
use Test::More tests => 14;
use Devel::Declare 'method' => sub {};
+use File::Spec;
sub test_eval;
-test_eval 'qq/method/';
-test_eval '`method`';
-test_eval 'qx/method/';
-test_eval 'qr/method/';
-test_eval '/method/';
-test_eval 's/method//';
-test_eval 'tr/method/METHOD/';
-test_eval 'q/method/';
-test_eval "'method'";
-test_eval '"method"';
-test_eval 'qw/method/';
-test_eval '<<method;
+QUOTE: {
+ test_eval 'qq/method/';
+ test_eval 'q/method/';
+ test_eval "'method'";
+ test_eval '"method"';
+ test_eval 'qw/method/';
+ test_eval '<<method;
tum ti tum
method';
-test_eval 'no warnings "reserved"; open method, "</dev/null"';
-test_eval '<method>';
+}
+SYSTEM: {
+ test_eval 'sub {`method`}'; # compiled to prevent calling arbitrary exe!
+ test_eval 'sub { qx{method} }';
+}
+
+REGEX: {
+ local $_=''; # the passing results will act on $_
+ test_eval 'qr/method/';
+ test_eval '/method/';
+ test_eval 's/method//';
+ test_eval 'tr/method/METHOD/';
+}
+
+FILE: {
+ test_eval q{ no warnings 'reserved'; open method, '<', File::Spec->devnull };
+ test_eval '<method>';
+}
+
sub test_eval {
my $what = shift;
eval $what;
More information about the Bast-commits
mailing list