a::Object::Hash->new({1 .. 8});
my @argument = ();
my $values = $hash->list(@argument);
isnt refaddr($hash), refaddr($values);
is_deeply [sort @{$values}], [sort %{$hash}];
isa_ok $hash
a::Object::Hash->new({1 .. 8});
my @argument = ();
my $keys = $hash->keys(@argument);
isnt refaddr($hash), refaddr($keys);
is_deeply [sort @$keys], [1, 3, 5, 7];
isa_ok $hash, 'Data::
8});
my @argument = (1, 3);
my $filter_include = $hash->filter_include(@argument);
isnt refaddr($hash), refaddr($filter_include);
is_deeply $filter_include, {1 => 2, 3 => 4};
isa_o
8});
my @argument = (1, 3);
my $filter_exclude = $hash->filter_exclude(@argument);
isnt refaddr($hash), refaddr($filter_exclude);
is_deeply $filter_exclude, {5 => 6, 7 => 8};
isa_o
ash->iterator(@argument);
while (my $value = $iterator->()) {
push @$values, $value;
}
isnt refaddr($hash), refaddr($iterator);
ok $iterator,;
is_deeply [sort @{$values}], [sort values
sh->new({1 .. 8, 9, undef});
my @argument = (1);
my $exists = $hash->exists(@argument);
isnt refaddr($hash), refaddr($exists);
is $exists, 1;
isa_ok $hash, 'Data::Object::Hash';
isa
({1 .. 8, 9, undef, 10, ''});
my @argument = ();
my $invert = $hash->invert(@argument);
isnt refaddr($hash), refaddr($invert);
is_deeply $invert, {'' => 10, 2 => 1, 4 => 3, 6 => 5, 8 => 7}
method' => sub {
my $float = Data::Object::Float->new(1.25);
my $upto = $float->upto(10);
isnt refaddr($float), refaddr($upto);
is_deeply $upto, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
isa_ok $f
sub {
my $string = Data::Object::String->new('exciting');
my $ucfirst = $string->ucfirst;
isnt refaddr($string), refaddr($ucfirst);
is "$ucfirst", 'Exciting';
isa_ok $string, 'Data::Obje
$string = Data::Object::String->new(' system is ready ');
my $trimmed = $string->trim;
isnt refaddr($string), refaddr($trimmed);
is "$trimmed", 'system is ready';
isa_ok $string, 'D
ub {
my $string = Data::Object::String->new('exciting');
my $uppercased = $string->uc;
isnt refaddr($string), refaddr($uppercased);
is "$uppercased", 'EXCITING';
isa_ok $string, 'D
my $string = Data::Object::String->new('exciting');
my $uppercase = $string->uppercase;
isnt refaddr($string), refaddr($uppercase);
is "$uppercase", 'EXCITING';
isa_ok $string, 'Data
= Data::Object::String->new('ABC');
my $concatenated = $string->concat('DEF', 'GHI');
isnt refaddr($string), refaddr($concatenated);
is "$concatenated", 'ABCDEFGHI'; # ABCDEFGHI
is
ject::Hash->new({1 .. 8});
my @argument = (1, 3);
my $slice = $hash->slice(@argument);
isnt refaddr($hash), refaddr($slice);
is_deeply $slice, [2, 4];
isa_ok $hash, 'Data::Object::Has
Object::Hash->new({1 .. 8});
my @argument = (1);
my $delete = $hash->delete(@argument);
isnt refaddr($hash), refaddr($delete);
is $delete, 2;
is_deeply $hash, {3 .. 8};
isa_ok $hash,
method' => sub {
my $hash = Data::Object::Hash->new({1 .. 8});
my $pairs = $hash->pairs;
isnt refaddr($hash), refaddr($pairs);
is_deeply $_, [$_->[0], $_->[0] + 1] for @{$pairs};
isa_ok
sh->new({1 .. 8, 9, undef});
my @argument = ();
my $reverse = $hash->reverse(@argument);
isnt refaddr($hash), refaddr($reverse);
is_deeply $reverse, {8 => 7, 6 => 5, 4 => 3, 2 => 1};
isa
sub {
my $integer = Data::Object::Float->new(10.9999);
my $downto = $integer->downto(0);
isnt refaddr($integer), refaddr($downto);
is_deeply $downto, [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0];
:Code->new(sub { $_[0] % 2 });
my $conjoin = $code->conjoin(sub {1});
my $result;
isnt refaddr($code), refaddr($conjoin);
$result = $conjoin->(0);
ok !ref $result;
is "$result",
ub {
my $string = Data::Object::String->new('EXCITING');
my $lowercased = $string->lc;
isnt refaddr($string), refaddr($lowercased);
is "$lowercased", 'exciting'; # exciting
isa_ok $