summaryrefslogtreecommitdiff
path: root/tests/uniq
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/uniq
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/uniq')
-rw-r--r--tests/uniq/Makefile.am4
-rw-r--r--tests/uniq/Test.pm2
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/uniq/Makefile.am b/tests/uniq/Makefile.am
index b3bb3d17d..965433281 100644
--- a/tests/uniq/Makefile.am
+++ b/tests/uniq/Makefile.am
@@ -30,7 +30,7 @@ obs-plus44.I obs-plus44.X obs-plus45.I obs-plus45.X 50.I 50.X 51.I 51.X 52.I \
62.I 62.X 63.I 63.X 64.I 64.X 65.I 65.X 90.I 90.X 91.I 91.X 92.I 92.X 93.I \
93.X 94.I 94.X 101.I 101.X 102.I 102.X 110.I 110.X 111.I 111.X 112.I 112.X \
113.I 113.X 114.I 114.X 115.I 115.X 116.I 116.X 117.I 117.X 118.I 118.X 119.I \
-119.X 120.I 120.X
+119.X 120.I 120.X 121.I 121.X
run_gen = 1.O 1.E 2.O 2.E 3.O 3.E 4.O 4.E 5.O 5.E 6.O 6.E 7.O 7.E 8.O 8.E 9.O \
9.E 10.O 10.E 11.O 11.E 12.O 12.E 13.O 13.E 20.O 20.E 21.O 21.E 22.O 22.E \
23.O 23.E obs30.O obs30.E 31.O 31.E 32.O 32.E 33.O 33.E 34.O 34.E 35.O 35.E \
@@ -40,7 +40,7 @@ obs-plus44.O obs-plus44.E obs-plus45.O obs-plus45.E 50.O 50.E 51.O 51.E 52.O \
62.O 62.E 63.O 63.E 64.O 64.E 65.O 65.E 90.O 90.E 91.O 91.E 92.O 92.E 93.O \
93.E 94.O 94.E 101.O 101.E 102.O 102.E 110.O 110.E 111.O 111.E 112.O 112.E \
113.O 113.E 114.O 114.E 115.O 115.E 116.O 116.E 117.O 117.E 118.O 118.E 119.O \
-119.E 120.O 120.E
+119.E 120.O 120.E 121.O 121.E
##test-files-end
EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
diff --git a/tests/uniq/Test.pm b/tests/uniq/Test.pm
index fe0fc68a5..1eda7e224 100644
--- a/tests/uniq/Test.pm
+++ b/tests/uniq/Test.pm
@@ -105,6 +105,8 @@ my @tv = (
['119', '--all-repeated=badoption', "a\n", "", 1],
# Check that -d and -u suppress all output, as POSIX requires.
['120', '-d -u', "a\na\n\b", "", 0],
+['121', '-d -u -w340282366920938463463374607431768211456',
+ "a\na\n\b", "", 0],
);
sub test_vector