From ab8d701a12f7f49e6b03ae3957976b55205dc6c8 Mon Sep 17 00:00:00 2001
From: Graham McVicker <mcvicker@sanger.ac.uk>
Date: Tue, 10 Feb 2004 14:26:01 +0000
Subject: [PATCH] added additional test for rearrange.  Was returning undef
 instead of 0 or ""

---
 modules/t/argument.t | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/t/argument.t b/modules/t/argument.t
index 0be78206a5..e8fb3eee6a 100644
--- a/modules/t/argument.t
+++ b/modules/t/argument.t
@@ -5,7 +5,7 @@ use lib 't';
 
 BEGIN { $| = 1;  
 	use Test;
-	plan tests => 3;
+	plan tests => 4;
 }
 
 use TestUtils qw( debug );
@@ -23,3 +23,11 @@ my ($one, $two, $three) = rearrange(['ONE','TWO','THREE'],@args);
 ok($one == 1);
 ok($two == 2);
 ok($three == 3);
+
+#
+#regression test args with 0 were being set to undef instead of 0
+#
+@args = ('-ZERO' => 0, '-ONE' => 1);
+my $zero;
+($one, $zero) = rearrange(['ONE', 'ZERO'], @args);
+ok(defined($zero) && $zero == 0 && $one == 1);
-- 
GitLab