From: Vincent Pit Date: Sat, 2 Jan 2010 18:32:51 +0000 (+0100) Subject: Rename Sub::Op::Test to Sub::Op::LexicalSub X-Git-Tag: v0.01~5 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FSub-Op.git;a=commitdiff_plain;h=14a44e7b2f834cbd0d2ba8cc63deda55b3e5f0dd Rename Sub::Op::Test to Sub::Op::LexicalSub --- diff --git a/MANIFEST b/MANIFEST index b8e59cb..cae08bd 100644 --- a/MANIFEST +++ b/MANIFEST @@ -15,6 +15,6 @@ t/91-pod.t t/92-pod-coverage.t t/95-portability-files.t t/99-kwalitee.t -t/Sub-Op-Test/Makefile.PL -t/Sub-Op-Test/Test.xs -t/Sub-Op-Test/lib/Sub/Op/Test.pm +t/Sub-Op-LexicalSub/Makefile.PL +t/Sub-Op-LexicalSub/LexicalSub.xs +t/Sub-Op-LexicalSub/lib/Sub/Op/LexicalSub.pm diff --git a/Makefile.PL b/Makefile.PL index 248c76f..6069830 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -88,11 +88,11 @@ sub MY::postamble { <<' POSTAMBLE'; configure_test.pl: args.dat -t/Sub-Op-Test/Makefile: configure_test.pl +t/Sub-Op-LexicalSub/Makefile: configure_test.pl $(FULLPERLRUN) configure_test.pl -all clean:: t/Sub-Op-Test/Makefile - cd t/Sub-Op-Test && $(MAKE) $@ +all clean:: t/Sub-Op-LexicalSub/Makefile + cd t/Sub-Op-LexicalSub && $(MAKE) $@ clean:: $(RM_RF) args.dat diff --git a/configure_test.pl b/configure_test.pl index 447376d..31d9929 100644 --- a/configure_test.pl +++ b/configure_test.pl @@ -37,7 +37,7 @@ my $ret = EXIT_FAILURE; my $guard = bless { cwd => do { require Cwd; Cwd::cwd() } }, 'CwdSaver'; - chdir 't/Sub-Op-Test' or die "chdir('t/Sub-Op-Test'): $!"; + chdir 't/Sub-Op-LexicalSub' or die "chdir('t/Sub-Op-LexicalSub'): $!"; system { $^X } $^X, 'Makefile.PL', @args; if ($? == -1) { diff --git a/lib/Sub/Op.pm b/lib/Sub/Op.pm index 1702f3e..8e380ca 100644 --- a/lib/Sub/Op.pm +++ b/lib/Sub/Op.pm @@ -374,7 +374,7 @@ BEGIN { _monkeypatch() } =head1 EXAMPLES -See the F directory that implements a complete example. +See the F directory that implements a complete example. =head1 DEPENDENCIES diff --git a/samples/try.pl b/samples/try.pl index a3e25b5..7064549 100755 --- a/samples/try.pl +++ b/samples/try.pl @@ -6,14 +6,14 @@ use strict; use warnings; use blib; -use blib 't/Sub-Op-Test'; +use blib 't/Sub-Op-LexicalSub'; my $code = $ARGV[0]; die "Usage: $0 'code involving f() and g()'" unless defined $code; my $cb = eval <<"CODE"; - use Sub::Op::Test f => sub { say 'f(' . join(', ', \@_) . ')'; \@_ }; - use Sub::Op::Test g => sub { say 'g(' . join(', ', \@_) . ')'; \@_ }; + use Sub::Op::LexicalSub f => sub { say 'f(' . join(', ', \@_) . ')'; \@_ }; + use Sub::Op::LexicalSub g => sub { say 'g(' . join(', ', \@_) . ')'; \@_ }; sub { $code } CODE die $@ if $@; diff --git a/t/10-base.t b/t/10-base.t index 1f785e5..c1760c1 100644 --- a/t/10-base.t +++ b/t/10-base.t @@ -3,7 +3,7 @@ use strict; use warnings; -use blib 't/Sub-Op-Test'; +use blib 't/Sub-Op-LexicalSub'; use Test::More tests => 2 * 15 + 3 * 2 + 2 * 28; @@ -36,7 +36,7 @@ our $called; my $test = "{\n"; for my $name (@names) { $test .= <<" INIT" - use Sub::Op::Test $name => sub { + use Sub::Op::LexicalSub $name => sub { ++\$called; my \$exp = shift \@exp; is_deeply \\\@_, \$exp, '$name: arguments are correct'; diff --git a/t/11-existing.t b/t/11-existing.t index fae36fc..58e23a0 100644 --- a/t/11-existing.t +++ b/t/11-existing.t @@ -3,7 +3,7 @@ use strict; use warnings; -use blib 't/Sub-Op-Test'; +use blib 't/Sub-Op-LexicalSub'; use Test::More tests => (4 + 2 * 4) + (2 * 5); @@ -39,7 +39,7 @@ our $called; my $test = "{\n"; for my $name (@names) { $test .= <<" INIT" - use Sub::Op::Test $name => sub { + use Sub::Op::LexicalSub $name => sub { ++\$called; my \$exp = shift \@exp; is_deeply \\\@_, \$exp, '$name: arguments are correct'; diff --git a/t/Sub-Op-Test/Test.xs b/t/Sub-Op-LexicalSub/LexicalSub.xs similarity index 68% rename from t/Sub-Op-Test/Test.xs rename to t/Sub-Op-LexicalSub/LexicalSub.xs index 4a7b970..e67d5ba 100644 --- a/t/Sub-Op-Test/Test.xs +++ b/t/Sub-Op-LexicalSub/LexicalSub.xs @@ -6,23 +6,23 @@ #include "perl.h" #include "XSUB.h" -#define __PACKAGE__ "Sub::Op::Test" +#define __PACKAGE__ "Sub::Op::LexicalSub" #define __PACKAGE_LEN__ (sizeof(__PACKAGE__)-1) #include "sub_op.h" -STATIC HV *sub_op_test_map = NULL; +STATIC HV *sols_map = NULL; -STATIC OP *sub_op_test_check(pTHX_ OP *o, void *ud_) { +STATIC OP *sols_check(pTHX_ OP *o, void *ud_) { char buf[sizeof(void*)*2+1]; SV *cb = ud_; - (void) hv_store(sub_op_test_map, buf, sprintf(buf, "%"UVxf, PTR2UV(o)), cb, 0); + (void) hv_store(sols_map, buf, sprintf(buf, "%"UVxf, PTR2UV(o)), cb, 0); return o; } -STATIC OP *sub_op_test_pp(pTHX) { +STATIC OP *sols_pp(pTHX) { dSP; dMARK; SV *cb; @@ -31,7 +31,7 @@ STATIC OP *sub_op_test_pp(pTHX) { { char buf[sizeof(void*)*2+1]; SV **svp; - svp = hv_fetch(sub_op_test_map, buf, sprintf(buf, "%"UVxf, PTR2UV(PL_op)), 0); + svp = hv_fetch(sols_map, buf, sprintf(buf, "%"UVxf, PTR2UV(PL_op)), 0); if (!svp) RETURN; cb = *svp; @@ -57,13 +57,13 @@ STATIC OP *sub_op_test_pp(pTHX) { /* --- XS ------------------------------------------------------------------ */ -MODULE = Sub::Op::Test PACKAGE = Sub::Op::Test +MODULE = Sub::Op::LexicalSub PACKAGE = Sub::Op::LexicalSub PROTOTYPES: ENABLE BOOT: { - sub_op_test_map = newHV(); + sols_map = newHV(); } void @@ -76,9 +76,9 @@ PPCODE: cb = SvRV(cb); if (SvTYPE(cb) >= SVt_PVCV) { c.name = SvPV_const(name, c.len); - c.check = sub_op_test_check; + c.check = sols_check; c.ud = SvREFCNT_inc(cb); - c.pp = sub_op_test_pp; + c.pp = sols_pp; sub_op_register(aTHX_ &c); } } diff --git a/t/Sub-Op-Test/Makefile.PL b/t/Sub-Op-LexicalSub/Makefile.PL similarity index 96% rename from t/Sub-Op-Test/Makefile.PL rename to t/Sub-Op-LexicalSub/Makefile.PL index b75f206..6fd5065 100644 --- a/t/Sub-Op-Test/Makefile.PL +++ b/t/Sub-Op-LexicalSub/Makefile.PL @@ -4,7 +4,7 @@ use strict; use warnings; use ExtUtils::MakeMaker; -my $dist = 'Sub-Op-Test'; +my $dist = 'Sub-Op-LexicalSub'; (my $name = $dist) =~ s{-}{::}g; diff --git a/t/Sub-Op-Test/lib/Sub/Op/Test.pm b/t/Sub-Op-LexicalSub/lib/Sub/Op/LexicalSub.pm similarity index 90% rename from t/Sub-Op-Test/lib/Sub/Op/Test.pm rename to t/Sub-Op-LexicalSub/lib/Sub/Op/LexicalSub.pm index ad379a3..8d04dc0 100644 --- a/t/Sub-Op-Test/lib/Sub/Op/Test.pm +++ b/t/Sub-Op-LexicalSub/lib/Sub/Op/LexicalSub.pm @@ -1,4 +1,4 @@ -package Sub::Op::Test; +package Sub::Op::LexicalSub; use strict; use warnings;