summaryrefslogtreecommitdiff
path: root/tests/join/Test.pm
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-12-13 22:03:54 +0100
committerJim Meyering <jim@meyering.net>2006-12-13 22:03:54 +0100
commitec95137cc376119f634610a7683a296fc7b78ea4 (patch)
tree52d315f085e18022db44722d7e58f3e4635d84d9 /tests/join/Test.pm
parentae3ee95eb8372ec5947e3c790c6ea77bc703c160 (diff)
downloadcoreutils-ec95137cc376119f634610a7683a296fc7b78ea4.tar.xz
Remove some arbitrary restrictions on size fields,
so that commands like "sort -k 18446744073709551616" no longer fail merely because 18446744073709551616 doesn't fit in uintmax_t. The trick is that these fields can all be treated as effectively infinity; their exact values don't matter, since no internal buffer can be that long. * src/join.c (string_to_join_field): Verify that SIZE_MAX <= ULONG_MAX if the code assumes this. Silently truncate too-large values to SIZE_MAX, as the remaining code will do the right thing in this case. * src/sort.c (parse_field_count): Likewise. * src/uniq.c (size_opt, main): Likewise. * tests/join/Test.pm (bigfield): New test. * tests/sort/Test.pm (bigfield): New test. * tests/uniq/Test.pm (121): New test. Signed-off-by: Jim Meyering <jim@meyering.net>
Diffstat (limited to 'tests/join/Test.pm')
-rw-r--r--tests/join/Test.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/join/Test.pm b/tests/join/Test.pm
index 37b1449ac..3d60ce3dc 100644
--- a/tests/join/Test.pm
+++ b/tests/join/Test.pm
@@ -136,6 +136,9 @@ my @tv = (
[t_subst "a:1\nb:1\n", t_subst "a:2:\nb:2:\n"],
t_subst "a:1:2:\nb:1:2:\n", 0],
+['bigfield', '-1 340282366920938463463374607431768211456 -2 2',
+ ["a\n", "b\n"], " a b\n", 0],
+
# FIXME: change this to ensure the diagnostic makes sense
['invalid-j', '-j x', {}, "", 1],