diff options
author | Bo Borgerson <gigabo@gmail.com> | 2008-06-19 15:37:21 -0400 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-06-20 08:47:28 +0200 |
commit | 02bfd65480a24760e49a3cd85d38e8802ea264a5 (patch) | |
tree | b480b47168888af0bb85dc42456c62c4c536b673 /tests | |
parent | 2c88abe2a2a5579cb1673af5f6a28204305a45f5 (diff) | |
download | coreutils-02bfd65480a24760e49a3cd85d38e8802ea264a5.tar.xz |
sort: Fix bug where --batch-size option shrank SORT_SIZE.
* src/sort.c (specify_nmerge, main): Only adjust SORT_SIZE if it's already set.
* tests/misc/sort-merge: Test bug fix.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/misc/sort-merge | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/misc/sort-merge b/tests/misc/sort-merge index a2524c40c..fb7c63cc1 100755 --- a/tests/misc/sort-merge +++ b/tests/misc/sort-merge @@ -27,6 +27,8 @@ my $prog = 'sort'; # three empty files and one that says 'foo' my @inputs = (+(map{{IN=> {"empty$_"=> ''}}}1..3), {IN=> {foo=> "foo\n"}}); +my $big_input = "aaa\n" x 1024; + # don't need to check for existence, since we're running in a temp dir my $badtmp = 'does/not/exist'; @@ -66,6 +68,11 @@ my @Tests = ['nmerge-no', "-m --batch-size=2 -T$badtmp", @inputs, {ERR_SUBST=>"s|: $badtmp/sort.+||"}, {ERR=>"$prog: cannot create temporary file\n"}, {EXIT=>2}], + + # This used to fail because setting batch-size without also setting + # buffer size would cause the buffer size to be set to the minimum. + ['batch-size', "--batch-size=16 -T$badtmp", {IN=> {big=> $big_input}}, + {OUT=>$big_input}], ); my $save_temps = $ENV{DEBUG}; |