X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=t%2Fon_destroy.t;h=e79451005d52296b27fa3749be52873ff71a324b;hp=0de67d0bcde10c116e49270dd20a7dff3b1ea72e;hb=4452b5ebd8f202d72260325768512230c93ef6f2;hpb=02d0dfd3f22f8f7c5d1e189dbe29034b9da9f510 diff --git a/t/on_destroy.t b/t/on_destroy.t index 0de67d0b..e7945100 100644 --- a/t/on_destroy.t +++ b/t/on_destroy.t @@ -1,6 +1,5 @@ #!perl -w -use strict; -use v5.10.1; +use v5.12; use Test::More; require_ok 'PublicInbox::OnDestroy'; my @x; @@ -25,6 +24,11 @@ $od = PublicInbox::OnDestroy->new($$, sub { $tmp = $$ }); undef $od; is($tmp, $$, '$tmp set to $$ by callback'); +$od = PublicInbox::OnDestroy->new($$, sub { $tmp = 'foo' }); +$od->cancel; +$od = undef; +isnt($tmp, 'foo', '->cancel'); + if (my $nr = $ENV{TEST_LEAK_NR}) { for (0..$nr) { $od = PublicInbox::OnDestroy->new(sub { @x = @_ }, qw(x y));