X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fquote.t;h=921cc94255f28c0234e0e05461398bc6869b82cd;hb=04f5c3c0c543257e514a75916f4e240e994dbfdb;hp=a173dc2f66d6bdecde7a20ea044360f5a9dd674d;hpb=0c232d04c287dedaf3cbc2cfbae8a6fb5a0bcb56;p=p5sagit%2FDevel-Declare.git diff --git a/t/quote.t b/t/quote.t index a173dc2..921cc94 100644 --- a/t/quote.t +++ b/t/quote.t @@ -1,33 +1,41 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 15; use Devel::Declare 'method' => sub {}; +use File::Spec; sub test_eval; -TODO: { - local $TODO = "dd_ck_const doesn't special-case ops created in quotelike contexts"; - test_eval 'qr/method/'; +QUOTE: { test_eval 'qq/method/'; + test_eval 'q/method/'; + test_eval "'method'"; + test_eval '"method"'; + test_eval 'qw/method/'; + test_eval '< 42 }'; +} + +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 '`method`'; - test_eval 'qx/method/'; test_eval 'tr/method/METHOD/'; - } -# these ones work OK -test_eval 'q/method/'; -test_eval "'method'"; -test_eval '"method"'; -test_eval 'qw/method/'; -test_eval '<'; +FILE: { + test_eval q{ no warnings 'reserved'; open method, '<', File::Spec->devnull }; + test_eval ''; +} sub test_eval { my $what = shift;