Skip to content

Commit

Permalink
Added integer key tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stevieb9 committed Jul 16, 2021
1 parent bd04850 commit 94e52b5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions t/04-key.t
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,28 @@ use Test::More;
}
}

# integers
{
my %key_hash = (
1 => 1,
11 => 11,
10 => 10,
1000 => 1000,
65535 => 65535,
);

for (keys %key_hash) {

my $k = tie my $sv, 'IPC::Shareable', {key => $_, create => 1, destroy => 1};

my $attr_key = $k->attributes('key');
is $attr_key, $_, "'$_' as key is the proper attribute ok";

my $key = $k->seg->key;
is $key, $key_hash{$_}, "...and key '$_' converted to '$key' ok";

$k->clean_up_all;
}
}

done_testing();

0 comments on commit 94e52b5

Please sign in to comment.