summaryrefslogtreecommitdiff
path: root/tests/misc/seq.pl
AgeCommit message (Collapse)Author
2014-06-18seq: fix incorrect output with start or end of -0Pádraig Brady
* src/seq.c (main): Avoid seq_fast() with a start or end of -0. * tests/misc/seq.pl: Add test cases. * NEWS: Mention the fix. Fixes http://bugs.gnu.org/17800
2014-01-02maint: update all copyright year number rangesBernhard Voelker
Run "make update-copyright", but then also run this, perl -pi -e 's/2\d\d\d-//' tests/sample-test to make that one script use the single most recent year number.
2013-01-26seq: fix to always honor the step valuePádraig Brady
* src/seq.c (main): With 3 positive integer args we were checking the end value was == "1", rather than the step value. * tests/misc/seq.pl: Add tests for this case. Reported by Marcel Böhme in http://bugs.gnu.org/13525
2013-01-26seq: fix misaligment with -w when no precision for start valuePádraig Brady
* src/seq.c (get_default_format): Also account for the case where '.' is auto added to the start value, which is significant when the number sequence narrows. * tests/misc/seq.pl: Add two new tests for the failing cases. * NEWS: Mention the fix. Fixes http://bugs.gnu.org/13394
2013-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright", but then also run this, perl -pi -e 's/2\d\d\d-//' tests/sample-test to make that one script use the single most recent year number.
2012-12-21seq: fix newline output when -s specifiedPádraig Brady
This regression was introduced in commit v8.19-132-g3786fb6. * src/seq.c (seq_fast): Don't use puts() to output the first number, and instead insert it into the buffer as for other numbers. Also output the terminator unconditionally. * tests/misc/seq.pl: Add some basic tests for the -s option. * NEWS: Mention the fix. * THANKS.in: Reported by Philipp Gortan.
2012-11-24seq: ensure correct output width for scientific notation inputPádraig Brady
* src/seq.c (scan_arg): Calculate the width more accurately for numbers specified using scientific notation. * tests/misc/seq.pl: Add tests for cases that were mishandled. * NEWS: Mention the fix. * THANKS.in: Reported by Marcel Böhme. Fixes http://bugs.gnu.org/12959
2012-09-14seq: 70x faster for non-negative whole numbers and incr==1Jim Meyering
Handle non-negative whole numbers robustly and efficiently when the increment is 1 and when no format-changing option is specified. On the correctness front, for very large numbers, seq now works fine: $ b=1000000000000000000000000000 $ src/seq ${b}09 ${b}11 100000000000000000000000000009 100000000000000000000000000010 100000000000000000000000000011 while the old one would infloop, printing garbage: $ seq ${b}09 ${b}11 | head -2 99999999999999999997315645440 99999999999999999997315645440 The new code is much more efficient, too: Old vs new: 55.81s vs 0.82s $ env time --f=%e seq $((10**8)) > /dev/null 55.81 $ env time --f=%e src/seq $((10**8)) > /dev/null 0.82 * seq.c (incr): New function, inspired by the one in cat.c. (cmp, seq_fast): New functions, inspired by code in nt-factor by Torbjörn Granlund and Niels Möller. (trim_leading_zeros): New function, without which cmp would malfunction. (all_digits_p): New function. (main): Hoist the format_str-vs-equal_width check to precede first treatment of operands, and insert code to call seq_fast when possible. * NEWS (Bug fixes): Mention the correctness fix. (Improvements): Mention the speed-up. * tests/misc/seq.pl: Exercise the new code. Improved by: Bernhard Voelker. http://thread.gmane.org/gmane.comp.gnu.coreutils.general/3340
2012-08-30tests: add .sh and .pl suffixes to shell and perl tests, respectivelyStefano Lattarini
Not only this shrinks the size of the generated Makefile (from > 6300 lines to ~3000), but will allow further simplifications in future changes. * tests/Makefile.am (TEST_EXTENSIONS): Add '.sh' and '.pl'. (PL_LOG_COMPILER, SH_LOG_COMPILER): New, still defined simply to $(LOG_COMPILER) for the time being. (TESTS, root_tests): Adjust as described. * All tests: Rename as described.