summaryrefslogtreecommitdiff
path: root/tests/factor
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-09-26 15:32:31 +0000
committerJim Meyering <jim@meyering.net>1998-09-26 15:32:31 +0000
commitd679ddd8399029d526a318c84baaacfc3be76e11 (patch)
tree44d51c61036088bb189ae356126e191711d7e513 /tests/factor
parentcded303e29d62feb95e8cf075f4eb86a3be72d81 (diff)
downloadcoreutils-d679ddd8399029d526a318c84baaacfc3be76e11.tar.xz
Add a test for negative argument.
Tweak postprocessing framework.
Diffstat (limited to 'tests/factor')
-rw-r--r--tests/factor/Test.pm4
1 files changed, 3 insertions, 1 deletions
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;