From d679ddd8399029d526a318c84baaacfc3be76e11 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 26 Sep 1998 15:32:31 +0000 Subject: Add a test for negative argument. Tweak postprocessing framework. --- tests/factor/Test.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/factor') diff --git a/tests/factor/Test.pm b/tests/factor/Test.pm index 1f1c54048..ea6e8766b 100644 --- a/tests/factor/Test.pm +++ b/tests/factor/Test.pm @@ -39,6 +39,7 @@ sub test_vector ['w', '4294966464', {}, '2 2 2 2 2 2 3 3 3 2485513', 0], ['x', '4294966896', {}, '2 2 2 2 3 3 3 11 607 1489', 0], ['y', '4294966998', {}, '2 3 7 3917 26107', 0], + ['z', '-1', {}, '', 1], ); my @tv; @@ -47,7 +48,8 @@ sub test_vector { my ($test_name, $arg, $in, $exp, $ret) = @$t; # Append a newline to end of each expected string. - push (@tv, [$test_name, $arg, $in, "$arg: $exp\n", $ret]); + my $prefixed_result = ($ret == 0 ? "$arg: $exp\n" : $exp); + push (@tv, [$test_name, $arg, $in, $prefixed_result, $ret]); } return @tv; -- cgit v1.2.3-70-g09d2