From: Florian Ragwitz Date: Fri, 10 Apr 2009 00:03:12 +0000 (+0000) Subject: Updated t/quote.t to quash warnings and use cross-platform /dev/null X-Git-Tag: 0.005000~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=13edc71b58c5f74174e0f97f5345ee0514ef8230;p=p5sagit%2FDevel-Declare.git Updated t/quote.t to quash warnings and use cross-platform /dev/null --- diff --git a/t/quote.t b/t/quote.t index 2a8c101..4104515 100644 --- a/t/quote.t +++ b/t/quote.t @@ -3,25 +3,38 @@ use warnings; 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 '<'; +} + +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 ''; +} sub test_eval { my $what = shift;