Move the test for the deprecated feature <<; out of t/base/lext.t
Nicholas Clark [Tue, 13 Oct 2009 12:44:50 +0000 (13:44 +0100)]
Tests in base can't utilise pragmata, specifically no warnings 'deprecated';

MANIFEST
t/base/lex.t
t/op/lex.t [new file with mode: 0644]

index 14a3a54..12f267e 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -4376,6 +4376,7 @@ t/op/lc.t                 See if lc, uc, lcfirst, ucfirst, quotemeta work
 t/op/lc_user.t                 See if user-defined lc et alia work
 t/op/length.t                  See if length works
 t/op/lex_assign.t              See if ops involving lexicals or pad temps work
+t/op/lex.t                     Tests too complex for t/base/lex.t
 t/op/lfs.t                     See if large files work for perlio
 t/op/list.t                    See if array lists work
 t/op/localref.t                        See if local ${deref} works
index 8cadf85..a5d87f6 100644 (file)
@@ -69,10 +69,11 @@ print qq
 print q<ok 17
 >;
 
-print <<;   # Yow!
-ok 18
-
-# previous line intentionally left blank.
+print "ok 18 - was the test for the deprecated use of bare << to mean <<\"\"\n";
+#print <<;   # Yow!
+#ok 18
+#
+## previous line intentionally left blank.
 
 print <<E1 eq "foo\n\n" ? "ok 19\n" : "not ok 19\n";
 @{[ <<E2 ]}
diff --git a/t/op/lex.t b/t/op/lex.t
new file mode 100644 (file)
index 0000000..3f00248
--- /dev/null
@@ -0,0 +1,22 @@
+#!perl -w
+use strict;
+
+require './test.pl';
+
+plan(tests => 2);
+
+{
+    no warnings 'deprecated';
+    print <<;   # Yow!
+ok 1
+
+    # previous line intentionally left blank.
+
+    my $yow = "ok 2";
+    print <<;   # Yow!
+$yow
+
+    # previous line intentionally left blank.
+}
+
+curr_test(3);