<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/tests/misc/sort-debug-keys, branch v8.9</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v8.9</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v8.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2011-01-01T21:16:47Z</updated>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2011-01-01T21:16:47Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2011-01-01T10:37:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=9d6231ef2a74671fa08bc263519edfe46e8d1805'/>
<id>urn:sha1:9d6231ef2a74671fa08bc263519edfe46e8d1805</id>
<content type='text'>
Run "make update-copyright".
</content>
</entry>
<entry>
<title>tests: substitute the single-program $VERBOSE/--version uses</title>
<updated>2010-11-17T20:45:51Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2010-11-17T20:35:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=293c37b9061c1afd0acd143bbded637a8f00b3a0'/>
<id>urn:sha1:293c37b9061c1afd0acd143bbded637a8f00b3a0</id>
<content type='text'>
Automatically make all of the changes like this:

  -test "$VERBOSE" = yes &amp;&amp; chgrp --version
  +print_ver_ chgrp

git grep -l 'VERBOSE.*--version'|xargs perl -pi -e \
  's/test "\$VERBOSE" = yes &amp;&amp; (\w+) --version/print_ver_ $1/'
</content>
</entry>
<entry>
<title>tests: convert first batch of tests from test-lib.sh to init.sh</title>
<updated>2010-11-17T19:48:57Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2010-11-14T10:05:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=f38becab02472e6872048a1951b249b2a3c054df'/>
<id>urn:sha1:f38becab02472e6872048a1951b249b2a3c054df</id>
<content type='text'>
Initially, I did this,
git grep -l srcdir/test-lib.sh|xargs perl -p0i -e '~180-byte script'
but that line would have been much longer than the maximum permitted
by coreutils' commit hook, and wasn't readable besides, so here's a
more readable version:

lhs=$(printf '%s\\n' \
'if test "$VERBOSE" = yes; then' \
'  set -x' \
'  touch --version' \
'fi' \
'' \
'. $srcdir/test-lib.sh' \
  | sed 's/\$/\\\$/g;s/touch/(\\w+)/')

rhs=$(printf '%s\\n' \
'. "${srcdir=.}/init.sh"; path_prepend_ ../src' \
'test "$VERBOSE" = yes &amp;&amp; FIXME --version' \
  | sed 's/\$/\\\$/g;s/FIXME/\$1/')

git grep -l srcdir/test-lib.sh|xargs perl -p0i -e "s,$lhs,$rhs,"
</content>
</entry>
<entry>
<title>tests: fix a printf portability issue</title>
<updated>2010-09-20T14:23:20Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2010-09-20T14:23:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=4727aab1b1964913cb83db65d59ba65c198d9d84'/>
<id>urn:sha1:4727aab1b1964913cb83db65d59ba65c198d9d84</id>
<content type='text'>
* tests/misc/sort-debug-keys: Don't depend on
printf supporting \xhh format, which isn't supported
by dash for example.  Also change from double quoted
strings to single quoted, when we don't need any
variable interpolation.
</content>
</entry>
<entry>
<title>sort: tune and refactor --debug code, and fix minor underlining bug</title>
<updated>2010-08-05T20:28:54Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2010-08-05T20:28:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=bdde34f95858e6ec3e6912055da3df0b033a1518'/>
<id>urn:sha1:bdde34f95858e6ec3e6912055da3df0b033a1518</id>
<content type='text'>
Formerly, the 'compare' function and some of its subroutines had a
debugging flag, which caused them to output underlines.  This
change refactors the code so that debugging output is
more-separated from the actual sorting.  In the process, the
change fixes a minor error in the debugging output.  The change
shortens the source code and executable size a tad, and improves
CPU performance by 2.4% on my platform with a simple benchmark (C
locale, line sorting, no debug).

* src/sort.c (long_double, strtold): Move back to prelude, since
they're now used by multiple functions again.
(unit_order): Move to file scope, since it's now used by two functions.
(find_unit_order, human_numcompare, numcompare, general_numcompare):
Remove endptr parameter.  All callers changed.
(human_numcompare): Args are now const pointers.
(getmonth): Endptr is now non-const.
(key_numeric): Move up, since it's needed earlier.
(debug_key): Take a line and a key as argument, instead of having
the caller figure out where the field is.
(debug_line): New function.
(keycompare, compare): Omit debug parameter; debug output now done
elsewhere.  All callers changed.
(write_line): Renamed from write_bytes; all callers changed.
Use debug_line (not 'compare') to output debug info.
Use a slightly faster check for whether output file is stdout.
(check): Don't do debugging output; it's not that useful here,
and it confuses the code.
(main): Check for incompatibility between -c and --debug.
Use standard diagnostic for incompatible options.
* tests/misc/sort-debug-keys: Fix test case: "--Mi-1" is not
a number, so its first character should not be underlined when
debugging a numeric sort.
</content>
</entry>
<entry>
<title>sort: fix bug in --debug when \0 is followed by \t</title>
<updated>2010-08-03T17:25:47Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2010-08-03T17:24:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=a2cebacf9748d60d6763f8ada68a10958a9cbda2'/>
<id>urn:sha1:a2cebacf9748d60d6763f8ada68a10958a9cbda2</id>
<content type='text'>
* src/sort.c (debug_width): New function, which does not stop
counting tabs at \0, and also invokes mbsnwidth.  Stamp out strnlen!
(count_tabs): Remove.
(debug_key): Use debug_width instead of mbsnwidth and count_tabs.
* tests/misc/sort-debug-keys: Check that \0 and \t intermix.
</content>
</entry>
<entry>
<title>sort: revert recent -h changes and use a more-conservative approach</title>
<updated>2010-08-03T02:21:02Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2010-08-03T02:18:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=94615d2acfdccbbeb8eb6f8931d0e252b05e1484'/>
<id>urn:sha1:94615d2acfdccbbeb8eb6f8931d0e252b05e1484</id>
<content type='text'>
* NEWS: Document changes to sort -h, which are now minor with
respect to the pre-July-30th version.
* doc/coreutils.texi (sort invocation): Likewise.  The
documentation now describes how -h comparison is done rather than
being vague with border cases.
* src/sort.c (long_double, strtold): Move back to general_numcompare.
(LD, compute_human): Remove.
(find_unit_order): Remove THOU_SEP parameter, since thousands
separators are now allowed by all callers.  Revert to previous
behavior of sorting by suffix, and returning the order rather than
2 * order + binary, since we no longer care whether binary powers
are being used.  However, treat all zeros the same, instead of
sorting 0M before 0G; this is more consistent with the desired
behavior of sorting -1G before -1M.
* tests/misc/sort (h1, h3, h6): Adjust to match mostly-reverted
behavior.  However, check that all zeros sort together.
* tests/misc/sort-debug-keys: Omit a "_", since the trailing "i"
in "1234Gi" is no longer part of the key.
</content>
</entry>
<entry>
<title>sort: -h now handles comparisons such as 6000K vs 5M and 5MiB vs 5MB</title>
<updated>2010-07-30T07:53:46Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2010-07-30T07:52:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=abd040180e210e74448c42f094aab1769ca6c636'/>
<id>urn:sha1:abd040180e210e74448c42f094aab1769ca6c636</id>
<content type='text'>
* NEWS: Document changes to sort -h.
* doc/coreutils.texi (sort invocation): Likewise.
* src/sort.c (long_double, strtold): Move to prelude, since they're
now used by multiple functions.
(LD): New macro.
(struct keyfield.iec_present): Remove this member.  All uses removed.
(check_mixed_SI_IEC): Remove.  This code was busted in the presence
of multiple threads, as it had a race condition.
(find_unit_order): Remove arg KEY; add arg THOU_SEP; arg ENDPTR is
now char ** rather than char const **.  Return an integer that
distinguishes decimal from binary powers.  Parse the number
consistently with the intersection of strtold and strnumcmp.
Set *ENDPTR unconditionally.
(compute_human): New static function.
(human_numcompare): Remove arg KEY.  Remove 'const' from other args.
Use strnumcmp if possible, but fall back on floating point if not.
(numcompare, general_numcompare): Arg EA is now char ** rather
than char const **.
(numcompare): Adjust to new find_unit_order signature and behavior.
(keycompare): Adjus to new human_numcompare signature.
* tests/misc/sort (h1, h3, h4, h6): Adjust to new behavior.
* tests/misc/sort-debug-keys: Likewise.
</content>
</entry>
<entry>
<title>tests: fix sort-debug-keys when fr_FR.utf8 not available</title>
<updated>2010-05-18T22:44:34Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2010-05-18T22:42:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=9f1d4e3e6f2b6cc8a3c70cc473b3ba714ecc2656'/>
<id>urn:sha1:9f1d4e3e6f2b6cc8a3c70cc473b3ba714ecc2656</id>
<content type='text'>
* tests/misc/sort-debug-keys: Correctly check for the absence
of the French UTF8 locale.
</content>
</entry>
<entry>
<title>tests: fix sort-debug-keys when fr_FR.utf8 not available</title>
<updated>2010-05-12T13:53:45Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2010-05-12T13:47:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=144d6e5f53b59cec504b1194b4f420144896f9ae'/>
<id>urn:sha1:144d6e5f53b59cec504b1194b4f420144896f9ae</id>
<content type='text'>
* tests/misc/sort-debug-keys: Don't verify (or even run)
the fr_FR tests when that locale is not available on the system.
</content>
</entry>
</feed>
