Refactored reset_state() into t/util.pm
This commit is contained in:
parent
aefaad37a4
commit
497f272c12
6 changed files with 18 additions and 50 deletions
|
@ -10,16 +10,6 @@ BEGIN { use lib qw(.); require "t/util.pm"; require "stow"; }
|
|||
use Test::More tests => 3;
|
||||
use English qw(-no_match_vars);
|
||||
|
||||
# local utility
|
||||
sub reset_state {
|
||||
@Tasks = ();
|
||||
@Conflicts = ();
|
||||
%Link_Task_For = ();
|
||||
%Dir_Task_For = ();
|
||||
%Option = ();
|
||||
return;
|
||||
}
|
||||
|
||||
### setup
|
||||
eval { remove_dir('t/target'); };
|
||||
eval { remove_dir('t/stow'); };
|
||||
|
|
10
t/examples.t
10
t/examples.t
|
@ -10,16 +10,6 @@ BEGIN { use lib qw(.); require "t/util.pm"; require "stow"; }
|
|||
use Test::More tests => 4;
|
||||
use English qw(-no_match_vars);
|
||||
|
||||
# local utility
|
||||
sub reset_state {
|
||||
@Tasks = ();
|
||||
@Conflicts = ();
|
||||
%Link_Task_For = ();
|
||||
%Dir_Task_For = ();
|
||||
%Option = ();
|
||||
return;
|
||||
}
|
||||
|
||||
### setup
|
||||
eval { remove_dir('t/target'); };
|
||||
make_dir('t/target/stow');
|
||||
|
|
|
@ -11,16 +11,6 @@ use Test::More tests => 14;
|
|||
use Test::Output;
|
||||
use English qw(-no_match_vars);
|
||||
|
||||
# local utility
|
||||
sub reset_state {
|
||||
@Tasks = ();
|
||||
@Conflicts = ();
|
||||
%Link_Task_For = ();
|
||||
%Dir_Task_For = ();
|
||||
%Option = ();
|
||||
return;
|
||||
}
|
||||
|
||||
### setup
|
||||
eval { remove_dir('t/target'); };
|
||||
eval { remove_dir('t/stow'); };
|
||||
|
|
|
@ -11,16 +11,6 @@ use Test::More tests => 14;
|
|||
use Test::Output;
|
||||
use English qw(-no_match_vars);
|
||||
|
||||
# local utility
|
||||
sub reset_state {
|
||||
@Tasks = ();
|
||||
@Conflicts = ();
|
||||
%Link_Task_For = ();
|
||||
%Dir_Task_For = ();
|
||||
%Option = ();
|
||||
return;
|
||||
}
|
||||
|
||||
### setup
|
||||
eval { remove_dir('t/target'); };
|
||||
eval { remove_dir('t/stow'); };
|
||||
|
|
|
@ -11,16 +11,6 @@ use Test::More tests => 14;
|
|||
use Test::Output;
|
||||
use English qw(-no_match_vars);
|
||||
|
||||
# local utility
|
||||
sub reset_state {
|
||||
@Tasks = ();
|
||||
@Conflicts = ();
|
||||
%Link_Task_For = ();
|
||||
%Dir_Task_For = ();
|
||||
%Option = ();
|
||||
return;
|
||||
}
|
||||
|
||||
### setup
|
||||
eval { remove_dir('t/target'); };
|
||||
eval { remove_dir('t/stow'); };
|
||||
|
|
18
t/util.pm
18
t/util.pm
|
@ -7,6 +7,24 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
||||
#===== SUBROUTINE ===========================================================
|
||||
# Name : reset_state()
|
||||
# Purpose : reset internal state machine
|
||||
# Parameters: none
|
||||
# Returns : n/a
|
||||
# Throws : n/a
|
||||
# Comments : none
|
||||
#============================================================================
|
||||
sub reset_state {
|
||||
@::Tasks = ();
|
||||
@::Conflicts = ();
|
||||
%::Link_Task_For = ();
|
||||
%::Dir_Task_For = ();
|
||||
%::Option = ();
|
||||
return;
|
||||
}
|
||||
|
||||
#===== SUBROUTINE ===========================================================
|
||||
# Name : make_link()
|
||||
# Purpose : safely create a link
|
||||
|
|
Loading…
Reference in a new issue