From: "Joshua ben Jore" <twists@gmail.com>
Message-ID: <
dc5c751d0602200750j21447031m86ea670b04ac27ed@mail.gmail.com>
Includes changes to increment test count in ext/B/t/concise-xs.t and
uses "no warnings 'once';" in ext/B/t/b.t rather than kludging to
avoid the warning.
p4raw-id: //depot/perl@27254
@EXPORT_OK = qw(minus_c ppname save_BEGINs
class peekop cast_I32 cstring cchar hash threadsv_names
main_root main_start main_cv svref_2object opnumber
- amagic_generation perlstring
+ sub_generation amagic_generation perlstring
walkoptree_slow walkoptree walkoptree_exec walksymtable
parents comppadlist sv_undef compile_stats timing_info
begin_av init_av check_av end_av regex_padav dowarn
B::OP
|
- +---------------+--------+--------+
- | | | |
- B::UNOP B::SVOP B::PADOP B::COP
+ +---------------+--------+--------+-------+
+ | | | | |
+ B::UNOP B::SVOP B::PADOP B::COP B::PVOP
,' `-.
/ `--.
B::BINOP B::LOGOP
#define B_main_root() PL_main_root
#define B_main_start() PL_main_start
#define B_amagic_generation() PL_amagic_generation
+#define B_sub_generation() PL_sub_generation
#define B_defstash() PL_defstash
#define B_curstash() PL_curstash
#define B_dowarn() PL_dowarn
long
B_amagic_generation()
+long
+B_sub_generation()
+
B::AV
B_comppadlist()
$| = 1;
use warnings;
use strict;
-use Test::More tests => 55;
+use Test::More tests => 57;
BEGIN { use_ok( 'B' ); }
is(B::perlstring("wibble"), '"wibble"', "Testing B::perlstring()");
is(B::class(bless {}, "Wibble::Bibble"), "Bibble", "Testing B::class()");
is(B::cast_I32(3.14), 3, "Testing B::cast_I32()");
-is(B::opnumber("localtime"), 294);
+is(B::opnumber("localtime"), 294, "Testing opnumber with opname (localtime)");
+
+{
+ no warnings 'once';
+ my $sg = B::sub_generation();
+ *Whatever::hand_waving = sub { };
+ ok( $sg < B::sub_generation, "sub_generation increments" );
+}
+
+{
+ my $ag = B::amagic_generation();
+ {
+
+ package Whatever;
+ require overload;
+ overload->import( '""' => sub {"What? You want more?!"} );
+ }
+ ok( $ag < B::amagic_generation, "amagic_generation increments" );
+}
use Carp;
use Test::More tests => ( # per-pkg tests (function ct + require_ok)
40 + 16 # Data::Dumper, Digest::MD5
- + 511 + 233 # B::Deparse, B
+ + 511 + 234 # B::Deparse, B
+ 588 + 189 # POSIX, IO::Socket
+ 3 * ($] > 5.009)
+ 14 * ($] >= 5.009003)
main_start main_root main_cv init_av inc_gv hash
formfeed end_av dowarn diehook defstash curstash
cstring comppadlist check_av cchar cast_I32 bootstrap
- begin_av amagic_generation address
+ begin_av amagic_generation sub_generation address
)],
},