C:\Users\Theseus\perlmonks\sopw\11102936>dmake test
C:\"Dwimperl\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/00-load.t ....... # Testing SoPW_11102936 0.01, Perl 5.014002, C:\Dwimperl\perl\bin\perl.exe
t/00-load.t ....... ok
t/01-works.t ...... Not an ARRAY reference at C:\Users\Theseus\perlmonks\sopw\11102936\blib\lib/SoPW_11102936.pm line 78.
t/01-works.t ...... 1/9 # Looks like you planned 9 tests but ran 1.
# Looks like your test exited with 255 just after 1.
t/01-works.t ...... Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 8/9 subtests
t/manifest.t ...... skipped: Author tests not required for installation
t/pod-coverage.t .. skipped: Author tests not required for installation
t/pod.t ........... skipped: Author tests not required for installation
Test Summary Report
-------------------
t/01-works.t (Wstat: 65280 Tests: 1 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 9 tests but ran 1.
Files=5, Tests=2, 1 wallclock secs ( 0.05 usr + 0.05 sys = 0.09 CPU)
Result: FAIL
Failed 1/5 test programs. 0/2 subtests failed.
dmake: Error code 255, while making 'test_dynamic'
####
package SoPW_11102936;
use 5.006;
use strict;
use warnings FATAL => 'all';
=head1 NAME
SoPW_11102936 - The great new SoPW_11102936!
shift on empty array in list context broken
=head1 VERSION
Version 0.01
=cut
our $VERSION = '0.01';
=head1 SYNOPSIS
Quick summary of what the module does.
Perhaps a little code snippet.
use SoPW_11102936;
my $foo = SoPW_11102936->new();
...
=head1 EXPORT
A list of functions that can be exported. You can delete this section
if you don't export anything, such as for a purely object-oriented module.
=head1 SUBROUTINES/METHODS
=head2 new
=cut
sub new {
my $class = shift;
bless [], $class;
}
=head2 _empty
=cut
sub _empty {
my $self = shift;
$self;
}
=head2 _undef
=cut
sub _undef {
my $self = shift;
undef $self->[0];
$self;
}
=head2 context_scalar_shift
=cut
sub context_scalar_shift {
my $self = shift;
my $s = shift $self->[0];
$self->[0] = \$_;
$self;
}
=head2 context_list_shift
=cut
sub context_list_shift {
my $self = shift;
my @a = shift $self->[0];
$self->[0] = \@a;
$self;
}
=head2 context_scalar_splice
=cut
sub context_scalar_splice {
my $self = shift;
my $s = splice( $self->[0], 0 , 1 );
$self->[0] = \$s;
$self;
}
=head2 context_list_splice
=cut
sub context_list_splice {
my $self = shift;
my @a = splice( $self->[0], 0 , 1 );
$self->[0] = \@a;
$self;
}
sub unload {
my $self=shift;
return $self->[0];
}
=head1 AUTHOR
Don Coyote, C<< >>
=head1 BUGS
Please report any bugs or feature requests to C, or through
the web interface at L. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc SoPW_11102936
You can also look for information at:
=over 4
=item * RT: CPAN's request tracker (report bugs here)
L
=item * AnnoCPAN: Annotated CPAN documentation
L
=item * CPAN Ratings
L
=item * Search CPAN
L
=back
=head1 ACKNOWLEDGEMENTS
=head1 LICENSE AND COPYRIGHT
This software is Copyright (c) 2019 by Don Coyote.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
=cut
1; # End of SoPW_11102936
####
#!perl -T
use 5.006;
use strict;
use warnings FATAL => 'all';
use Test::More;
use SoPW_11102936;
my @methods = qw/
new
_empty
_undef
context_scalar_shift
context_list_shift
context_scalar_splice
context_list_splice
unload
/;
my @t_methods = grep /\Acontext/, @methods;
plan tests => 1 + ( scalar( @t_methods ) * 2 );
my $foo = SoPW_11102936->new;
isa_ok($foo, 'SoPW_11102936', 'its an SoPW object');
for my $method ( @t_methods ){
$foo->_empty();
$foo->$method();
is($foo->unload, (), "$method is empty");
};
for my $method ( @t_methods ){
$foo->_undef();
$foo->$method();
is($foo->unload, undef, "$method is undef");
};
diag( "Testing SoPW_11102936 $SoPW_11102936::VERSION, Perl $], $^X" );