Remaining nit in the deparsing of reversed foreach loops
[p5sagit/p5-mst-13.2.git] / ext / B / t / optree_concise.t
index cecc572..d4d6d32 100644 (file)
@@ -8,11 +8,10 @@ BEGIN {
         print "1..0 # Skip -- Perl configured without B module\n";
         exit 0;
     }
-    if ($Config{'extensions'} !~ /\bData\/Dumper\b/) {
+    if ($Config::Config{'extensions'} !~ /\bData\/Dumper\b/) {
        print
            "1..0 # Skip: Data::Dumper was not built, needed by OptreeCheck\n";
        exit 0;
-
     }
     require './test.pl';
 }
@@ -21,9 +20,9 @@ BEGIN {
 use OptreeCheck;       # ALSO DOES @ARGV HANDLING !!!!!!
 use Config;
 
-plan tests => 23;
+plan tests => 24;
 SKIP: {
-skip "no perlio in this build", 23 unless $Config::Config{useperlio};
+skip "no perlio in this build", 24 unless $Config::Config{useperlio};
 
 $SIG{__WARN__} = sub {
     my $err = shift;
@@ -250,24 +249,35 @@ EOT_EOT
 # 7  <@> leave[1 ref] vKP/REFC
 EONT_EONT
 
-checkOptree ( name     => 'cmdline self-strict compile err',
-             prog      => 'use strict; sort @a',
-             bcopts    => [qw/ -basic -concise -exec /],
-             noanchors => 1,
-             expect    => 'compilation errors',
-             expect_nt => 'compilation errors');
-
-checkOptree ( name     => 'error at -e line 1',
-             prog      => 'our @a; sort @a',
-             bcopts    => [qw/ -basic -concise -exec /],
-             noanchors => 1,
-             expect    => 'at -e line 1',
-             expect_nt => 'at -e line 1');
-
-checkOptree ( name     => 'cmdline -basic -concise -exec works',
-             prog      => 'our @a; sort @a',
-             bcopts    => [qw/ -basic -concise -exec /],
-             expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
+;
+$DB::single=1;
+checkOptree
+    ( name     => 'cmdline self-strict compile err using prog',
+      prog     => 'use strict; sort @a',
+      bcopts   => [qw/ -basic -concise -exec /],
+      errs     => 'Global symbol "@a" requires explicit package name at .*? line 1.',
+      );
+
+checkOptree
+    ( name     => 'cmdline self-strict compile err using code',
+      code     => 'use strict; sort @a',
+      bcopts   => [qw/ -basic -concise -exec /],
+      #noanchors       => 1,
+      errs     => 'Global symbol "@a" requires explicit package name at .*? line 1.',
+      );
+
+checkOptree
+    ( name     => 'useless use of sort in void context',
+      prog     => 'our @a; sort @a',
+      bcopts   => [qw/ -basic -concise -exec /],
+      errs     => 'Useless use of sort in void context at -e line 1.',
+      );
+
+checkOptree
+    ( name     => 'cmdline -basic -concise -exec works',
+      prog     => 'our @a; sort @a',
+      bcopts   => [qw/ -basic -concise -exec /],
+      expect   => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 # 1  <0> enter 
 # 2  <;> nextstate(main 1 -e:1) v
 # 3  <#> gv[*a] s