Skip to content

Commit

Permalink
Format test modules
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcj committed Apr 25, 2024
1 parent 7b906c3 commit 06e7623
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 45 deletions.
3 changes: 2 additions & 1 deletion tests/Accessor_maker.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package Accessor_maker;

sub import {
no strict 'refs';
*{ caller() . '::' . 'foo' } = sub { $_[0]->{ 'foo' } };
*{ caller() . '::' . 'foo' } = sub { $_[0]->{'foo'} };
}
1;
10 changes: 5 additions & 5 deletions tests/Alias1.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ use warnings;

use Exporter;

our @ISA = qw(Exporter);
our @ISA = qw(Exporter);
our @EXPORT = qw(is_3digits);

sub is_3digits {
my $val = shift;
my $retval = undef;
$retval=1 if $val =~ /^\d{3}$/;
return $retval;
my $val = shift;
my $retval = undef;
$retval = 1 if $val =~ /^\d{3}$/;
return $retval;
}

1;
16 changes: 8 additions & 8 deletions tests/Module1.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ my $y = 7;
$y++;

sub _aa {
$y++;
die;
die;
$y++;
die;
die;
}

sub xx {
$y++;
die;
$y++;
die;
}

sub yy {
$y++;
$y++;
}

sub zz {
my $x = shift;
$x++;
my $x = shift;
$x++;
}

1
Expand Down
16 changes: 8 additions & 8 deletions tests/Module2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ my $y = 7;
$y++;

sub _aa {
$y++;
die;
die;
$y++;
die;
die;
}

sub _xx {
$y++;
die;
$y++;
die;
}

sub yy {
$y++;
$y++;
}

sub zz {
my $x = shift;
$x++;
my $x = shift;
$x++;
}

1
Expand Down
2 changes: 1 addition & 1 deletion tests/Module_import.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package Module_import;

sub import {
print "Module_import\n";
print "Module_import\n";
}

1
22 changes: 11 additions & 11 deletions tests/dist/DC-Test-Dist/lib/DC/Test/Dist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ use warnings;
use DC::Test::Dist::M1;

sub new {
bless {}, shift
bless {}, shift
}

sub d1 {
my $self = shift;
if (@_) {
$self->{d1} = shift;
}
$self->{d1}
my $self = shift;
if (@_) {
$self->{d1} = shift;
}
$self->{d1}
}

sub d2 {
my $self = shift;
if (@_) {
$self->{d2} = shift;
}
$self->{d2}
my $self = shift;
if (@_) {
$self->{d2} = shift;
}
$self->{d2}
}

1
Expand Down
22 changes: 11 additions & 11 deletions tests/dist/DC-Test-Dist/lib/DC/Test/Dist/M1.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ use warnings;
# VERSION

sub new {
bless {}, shift
bless {}, shift
}

sub m1 {
my $self = shift;
if (@_) {
$self->{m1} = shift;
}
$self->{m1}
my $self = shift;
if (@_) {
$self->{m1} = shift;
}
$self->{m1}
}

sub m2 {
my $self = shift;
if (@_) {
$self->{m2} = shift;
}
$self->{m2}
my $self = shift;
if (@_) {
$self->{m2} = shift;
}
$self->{m2}
}

1
Expand Down

0 comments on commit 06e7623

Please sign in to comment.