[Bast-commits] r5865 - Devel-Declare/1.000/trunk/t

rafl at dev.catalyst.perl.org rafl at dev.catalyst.perl.org
Thu Apr 9 00:07:57 GMT 2009


Author: rafl
Date: 2009-04-09 01:07:57 +0100 (Thu, 09 Apr 2009)
New Revision: 5865

Added:
   Devel-Declare/1.000/trunk/t/quote.t
Log:
Test that quoted words aren't interpreted as keywords.

Added: Devel-Declare/1.000/trunk/t/quote.t
===================================================================
--- Devel-Declare/1.000/trunk/t/quote.t	                        (rev 0)
+++ Devel-Declare/1.000/trunk/t/quote.t	2009-04-09 00:07:57 UTC (rev 5865)
@@ -0,0 +1,43 @@
+use strict;
+use warnings;
+use Test::More tests => 14;
+
+use Devel::Declare 'method' => sub {};
+
+sub test_eval;
+
+TODO: {
+    local $TODO = "dd_ck_const doesn't special-case ops created in quotelike contexts";
+    test_eval 'qr/method/';
+    test_eval 'qq/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 '<<method;
+tum ti tum
+method';
+    test_eval 'no warnings "reserved"; open method, "</dev/null"';
+    test_eval '<method>';
+}
+
+sub test_eval {
+    my $what = shift;
+    eval $what;
+    ok !$@, "$what" or d($@);
+}
+{
+  my %seen;
+  sub d { # diag the error the first time we get it
+    my $err = shift;
+    $err =~s/ at .*$//;
+    $seen{$err}++ or diag $err;
+  }
+}




More information about the Bast-commits mailing list