From b73343f9cd0936748b6fe5ecd19a42965bfa52f7 Mon Sep 17 00:00:00 2001 From: Jacob Pipkin Date: Thu, 1 Nov 2012 23:07:18 -0500 Subject: add ability to empty $temp_queue in order to facilitate unit testing --- SBO-Lib/lib/SBO/Lib.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'SBO-Lib/lib/SBO/Lib.pm') diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 24fae5f..1087fb4 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -749,10 +749,11 @@ sub add_to_queue ($) { } # recursively add a sbo's requirements to the build queue. -sub get_build_queue ($$) { +sub get_build_queue ($$;$) { exists $_[1] or script_error 'get_build_queue requires two arguments.'; - my ($sbos, $warnings) = @_; - state $temp_queue = [()]; + my ($sbos, $warnings, $empty) = @_; + state $temp_queue = []; + $temp_queue = [] if $empty; for my $sbo (@$sbos) { my %args = ( QUEUE => $temp_queue,, -- cgit v1.2.3