Acme-BLACKJ-Utils

 view release on metacpan or  search on metacpan

lib/Acme/BLACKJ/Utils.pm  view on Meta::CPAN

This module is my first CPAN distribution.  It is a product of the
Intermediate Perl exercises from Chapters 12 and 21 of that book.
The sum() function sums two values and returns the product to the 
caller.

Perhaps a little code snippet.

    use Acme::BLACKJ::Utils;

    my $foo = Acme::BLACKJ::Utils::sum(1,10);
    print "$foo\n"; # 11
    ...

=head1 SUBROUTINES/METHODS

=head2 sum

=cut

sub sum {
    my $a = shift;

t/00-load.t  view on Meta::CPAN

#!perl -T
use 5.006;
use strict;
use warnings FATAL => 'all';
use Test::More;

plan tests => 1;

BEGIN {
    use_ok( 'Acme::BLACKJ::Utils' ) || print "Bail out!\n";
}

diag( "Testing Acme::BLACKJ::Utils $Acme::BLACKJ::Utils::VERSION, Perl $], $^X" );

t/01-sum.t  view on Meta::CPAN

#!perl -T
use 5.006;
use strict;
use warnings FATAL => 'all';
use Test::More;

BEGIN {
    use_ok( 'Acme::BLACKJ::Utils' ) || print "Bail out!\n";
}

diag( "Testing Acme::BLACKJ::Utils $Acme::BLACKJ::Utils::VERSION, Perl $], $^X" );

ok( defined &Acme::BLACKJ::Utils::sum, 'Acme::BLACKJ::Utils::sum is defined' );

ok( &Acme::BLACKJ::Utils::sum(1, 1) eq 2, 'Sum of 1 + 1 should equal 2');
ok( &Acme::BLACKJ::Utils::sum(1, 2) ne 2, 'Sum of 1 + 2 should not equal 2');
ok( &Acme::BLACKJ::Utils::sum(1, 3) gt 3, 'Sum of 1 + 3 should be > 3');
ok( &Acme::BLACKJ::Utils::sum(1, 4) lt 6, 'Sum of 1 + 4 should be < 6');



( run in 0.408 second using v1.01-cache-2.11-cpan-de7293f3b23 )