| Revision 9f3297,
552 bytes
checked in by Tomash Brechko <tomash.brechko@…>, 4 years ago
(diff) |
|
Split the test case.
|
-
Property mode set to
100644
|
| Line | |
|---|
| 1 | use warnings; |
|---|
| 2 | use strict; |
|---|
| 3 | |
|---|
| 4 | use Test::More; |
|---|
| 5 | |
|---|
| 6 | use FindBin; |
|---|
| 7 | |
|---|
| 8 | use lib "$FindBin::Bin"; |
|---|
| 9 | use Memd; |
|---|
| 10 | |
|---|
| 11 | if ($Memd::memd) { |
|---|
| 12 | plan tests => 5; |
|---|
| 13 | } else { |
|---|
| 14 | plan skip_all => 'Not connected'; |
|---|
| 15 | } |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | my $key = "key_ref"; |
|---|
| 19 | my $value = "value ref check"; |
|---|
| 20 | ok($Memd::memd->set($key, $value), 'Store'); |
|---|
| 21 | my $h = $Memd::memd->get_multi($key); |
|---|
| 22 | is($h->{$key}, $value, 'Fetch'); |
|---|
| 23 | |
|---|
| 24 | my $old_key = $key; |
|---|
| 25 | substr($key, 3, 4, ""); |
|---|
| 26 | is($h->{$old_key}, $value, 'Access with the old key'); |
|---|
| 27 | ok(! exists $h->{$key}, 'Access with modified key'); |
|---|
| 28 | |
|---|
| 29 | ok($Memd::memd->delete($old_key), 'Delete'); |
|---|
Note: See
TracBrowser
for help on using the repository browser.