mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 05:29:30 +00:00
Use CleanupTask to ensure tool always, automatically cleans up. Move create triggers step before copy rows, to keep related code together.
This commit is contained in:
@@ -9,7 +9,7 @@ BEGIN {
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use Test::More tests => 2;
|
||||
use Test::More tests => 4;
|
||||
|
||||
use PerconaTest;
|
||||
use CleanupTask;
|
||||
@@ -30,6 +30,23 @@ is(
|
||||
"Cleanup task called after obj destroyed"
|
||||
);
|
||||
|
||||
|
||||
$foo = 0;
|
||||
my $set_foo = new CleanupTask(sub { $foo = 42; });
|
||||
|
||||
is(
|
||||
$foo,
|
||||
0,
|
||||
"Cleanup task not called yet"
|
||||
);
|
||||
|
||||
$set_foo = undef;
|
||||
is(
|
||||
$foo,
|
||||
42,
|
||||
"Cleanup task called after obj=undef"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
Reference in New Issue
Block a user