This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Change concise.t to use Storable to test stash/src rendering of constant subs.
authorNicholas Clark <nick@ccl4.org>
Sat, 23 Oct 2010 17:06:42 +0000 (18:06 +0100)
committerNicholas Clark <nick@ccl4.org>
Sat, 23 Oct 2010 17:09:30 +0000 (18:09 +0100)
This allows B to be refactored to change the implementation of its constants.
Storable strives to main compatibility with 5.004 (or so), so unlikely to be
refactored soon.

ext/B/t/concise.t

index 2b67222..a6a1a78 100644 (file)
@@ -392,15 +392,18 @@ like($out, qr/FUNC: \*B::Concise::concise_cv_obj/,
 like($out, qr/FUNC: \*B::Concise::walk_output/,
      "stash rendering includes Concise::walk_output");
 
-like($out, qr/FUNC: \*B::Concise::PAD_FAKELEX_MULTI/,
+like($out, qr/\# 4\d\d: \s+ \$l->concise\(\$level\);/,
+     "src-line rendering works");
+
+$out = runperl ( switches => ["-MStorable", "-MO=Concise,-stash=Storable,-src"],
+                prog => '-e 1', stderr => 1 );
+
+like($out, qr/FUNC: \*Storable::BIN_MAJOR/,
      "stash rendering includes constant sub: PAD_FAKELEX_MULTI");
 
-like($out, qr/PAD_FAKELEX_MULTI is a constant sub, optimized to a IV/,
+like($out, qr/BIN_MAJOR is a constant sub, optimized to a IV/,
      "stash rendering identifies it as constant");
 
-like($out, qr/\# 4\d\d: \s+ \$l->concise\(\$level\);/,
-     "src-line rendering works");
-
 $out = runperl ( switches => ["-MO=Concise,-stash=ExtUtils::Mksymlists,-src,-exec"],
                 prog => '-e 1', stderr => 1 );