Add tests for not interpreting various things as barewords when they aren't.
Florian Ragwitz [Thu, 13 Aug 2009 20:30:15 +0000 (22:30 +0200)]
t/no-bareword.t [new file with mode: 0644]

diff --git a/t/no-bareword.t b/t/no-bareword.t
new file mode 100644 (file)
index 0000000..80f9b0d
--- /dev/null
@@ -0,0 +1,33 @@
+use strict;
+use warnings;
+use Test::More;
+
+our $i;
+BEGIN { $i = 0 };
+
+sub method { }
+BEGIN {
+        require Devel::Declare;
+        Devel::Declare->setup_for(
+                __PACKAGE__,
+                { "method" => { const => sub { $i++ } } },
+        );
+}
+
+{
+    package Foo;
+    sub method { }
+}
+
+Foo->method;
+BEGIN { is($i, 0) }
+
+my @foo = (method => 123);
+TODO: {
+    BEGIN {
+        local $TODO = 'fat commas not quoting barewords';
+        is($i, 0);
+    }
+}
+
+done_testing;