Subject: | better tests |
Requires Test::More.
--
Alexandr Ciornii, http://chorny.net
Subject: | test.pl |
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More;
BEGIN { plan tests => 5 };
use autobox;
use autobox::Core;
ok(1);
is("Hello"->uc(),"HELLO","uc");
my $arr = [ 1 .. 10 ];
my $elem=$arr->pop();
is($elem,10);
$elem=$arr->pop();
is($elem,9);
$arr->push(11);
my $arr1=$arr->grep(sub {$_[0] %2});
is_deeply($arr1, [1,3,5,7,11], "grep odd numbers");