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
<<' 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
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) {
=head1 EXAMPLES
-See the F<t/Sub-Op-Test> directory that implements a complete example.
+See the F<t/Sub-Op-LexicalSub> directory that implements a complete example.
=head1 DEPENDENCIES
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 $@;
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;
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';
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);
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';
#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;
{
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;
/* --- 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
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);
}
}
use warnings;
use ExtUtils::MakeMaker;
-my $dist = 'Sub-Op-Test';
+my $dist = 'Sub-Op-LexicalSub';
(my $name = $dist) =~ s{-}{::}g;
-package Sub::Op::Test;
+package Sub::Op::LexicalSub;
use strict;
use warnings;