This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove VMS-specific hacks from showlex.t.
[perl5.git] / ext / B / t / concise.t
index bb1056f..3541ce3 100644 (file)
@@ -10,7 +10,7 @@ BEGIN {
     require 'test.pl';         # we use runperl from 'test.pl', so can't use Test::More
 }
 
-plan tests => 163;
+plan tests => 167;
 
 require_ok("B::Concise");
 
@@ -502,4 +502,26 @@ $end =~ s/<NEXT>/$next/;
 
 like $out, qr/$end/, 'OP_AND->op_other points correctly';
 
+# test nextstate hints display
+
+{
+
+    $out = runperl(
+        switches => ["-MO=Concise"],
+        prog => q{my $x; use strict; use warnings; $x++; use feature q(:5.11); $x++},
+        stderr => 1,
+    );
+
+    my @hints = $out =~ /nextstate\([^)]+\) (.*) ->/g;
+
+    # handle test script run with PERL_UNICODE=""
+    s/>,<,// for @hints;
+    s/%,// for @hints;
+
+    is(scalar(@hints), 3, "3 hints");
+    is($hints[0], 'v:{',                           "hints[0]");
+    is($hints[1], 'v:*,&,{,x*,x&,x$,$',            "hints[1]");
+    is($hints[2], 'v:us,*,&,{,x*,x&,x$,$,fea=7', "hints[2]");
+}
+
 __END__