summaryrefslogtreecommitdiff
path: root/t/io/shm.t
diff options
context:
space:
mode:
Diffstat (limited to 't/io/shm.t')
-rw-r--r--t/io/shm.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/io/shm.t b/t/io/shm.t
index 0ba566b1d4..4a8941ec75 100644
--- a/t/io/shm.t
+++ b/t/io/shm.t
@@ -55,7 +55,7 @@ if (not defined $key) {
}
}
else {
- plan(tests => 13);
+ plan(tests => 15);
pass('acquired shared mem');
}
@@ -80,3 +80,13 @@ shmwrite $key, $int, 0, 1;
shmread $key, $number, 0, 1;
is("$number", $int, qq{"\$id" eq "$int"});
cmp_ok($number + 0, '==', $int, "\$id + 0 == $int");
+
+my ($fetch, $store) = (0, 0);
+{ package Counted;
+ sub TIESCALAR { bless [undef] }
+ sub FETCH { ++$fetch; $_[0][0] }
+ sub STORE { ++$store; $_[0][0] = $_[1] } }
+tie $ct, 'Counted';
+shmread $key, $ct, 0, 1;
+is($fetch, 1, "shmread FETCH once");
+is($store, 1, "shmread STORE once");