diff options
author | Joshua ben Jore <jjore@cpan.org> | 2006-02-20 03:50:15 -0600 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2006-02-21 00:02:46 +0000 |
commit | 5ce57cc063e43c30cba8f7b560bf201c2c4beb83 (patch) | |
tree | bd572abf7b732122a8a5e27117ddf08072eb9d2e | |
parent | 4bbb71267116eb89ad713505b2cb1ec776c520e0 (diff) | |
download | perl-5ce57cc063e43c30cba8f7b560bf201c2c4beb83.tar.gz |
Re: Patches: B, CGI, ExtUtils::MM_Unix
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
-rw-r--r-- | ext/B/B.pm | 8 | ||||
-rw-r--r-- | ext/B/B.xs | 4 | ||||
-rwxr-xr-x | ext/B/t/b.t | 22 | ||||
-rw-r--r-- | ext/B/t/concise-xs.t | 4 |
4 files changed, 30 insertions, 8 deletions
diff --git a/ext/B/B.pm b/ext/B/B.pm index 5b6c04e8a1..f157e7852e 100644 --- a/ext/B/B.pm +++ b/ext/B/B.pm @@ -18,7 +18,7 @@ require Exporter; @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 @@ -935,9 +935,9 @@ underlying C "inheritance": B::OP | - +---------------+--------+--------+ - | | | | - B::UNOP B::SVOP B::PADOP B::COP + +---------------+--------+--------+-------+ + | | | | | + B::UNOP B::SVOP B::PADOP B::COP B::PVOP ,' `-. / `--. B::BINOP B::LOGOP diff --git a/ext/B/B.xs b/ext/B/B.xs index bfccf7d273..23034c10ca 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -528,6 +528,7 @@ BOOT: #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 @@ -574,6 +575,9 @@ B_main_start() long B_amagic_generation() +long +B_sub_generation() + B::AV B_comppadlist() diff --git a/ext/B/t/b.t b/ext/B/t/b.t index 12e90927c1..95a5059ac8 100755 --- a/ext/B/t/b.t +++ b/ext/B/t/b.t @@ -22,7 +22,7 @@ BEGIN { $| = 1; use warnings; use strict; -use Test::More tests => 55; +use Test::More tests => 57; BEGIN { use_ok( 'B' ); } @@ -164,4 +164,22 @@ is(B::cstring("wibble"), '"wibble"', "Testing B::cstring()"); 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" ); +} diff --git a/ext/B/t/concise-xs.t b/ext/B/t/concise-xs.t index fa0e7dfba9..dcd868fa0f 100644 --- a/ext/B/t/concise-xs.t +++ b/ext/B/t/concise-xs.t @@ -117,7 +117,7 @@ use Getopt::Std; 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) @@ -156,7 +156,7 @@ my $testpkgs = { 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 )], }, |