Commit graph

925 commits

Author SHA1 Message Date
Sylvestre Ledru
59da0d8cd6 cp: add a unit test for issue 1665 2021-12-19 18:19:48 +01:00
electricboogie
a1960f5da0
Fix cp bug: pre-write permission change (#2769) 2021-12-15 22:18:02 +01:00
Sylvestre Ledru
52d2fe1d28 Try to unbreak the code coverage CI.
For some reasons, on windows, test_compress_fail is failing with a different
error. So, don't check the output on windows
2021-12-14 09:46:28 +01:00
electricboogie
c7f7a222b9
Fix mv bug: Should be able to stat files, but not able to mv if source and target are the same (#2763)
Closes #2760
2021-12-12 17:49:38 +01:00
Jan Verbeek
f2ddae93fa uucore::entries: Make Passwd::locate and Group::locate thread-safe 2021-11-26 14:48:33 +01:00
Roy Ivy III
f07a1749a1 fix spell-check errors 2021-11-19 17:55:02 -06:00
Sylvestre Ledru
43bdcaf212
Merge pull request #2532 from hbina/hbina-rm-silently-accept-presume-input-tty
Silently accepts ---presume-input-tty
2021-11-19 21:42:41 +01:00
Sylvestre Ledru
01440734a4
Merge pull request #2735 from thomasqueirozb/printenv_env_compat
env+printenv: use UResult + improve compatibility
2021-11-19 21:39:34 +01:00
Sylvestre Ledru
da69ab19db
Merge pull request #2745 from thomasqueirozb/chmod_uresult
chmod: use UResult
2021-11-19 21:38:31 +01:00
Smicry
fc851e036b
Implement tail -<number> (#2747)
And add obsolete_syntax test
2021-11-19 21:37:47 +01:00
Thomas Queiroz
fed596a23b
tests/chmod: change normal error to usage error 2021-11-12 19:07:37 -03:00
Sylvestre Ledru
177374aa5a
Merge pull request #2740 from jfinkels/seq-inf-width-spaces
seq: correct fixed-width spacing for inf sequences
2021-11-12 21:16:40 +01:00
Thomas Queiroz
c9624725ab
tests: use CmdResult::usage_error 2021-11-09 17:37:05 -03:00
Jeffrey Finkelstein
0b86afa858 seq: correct fixed-width spacing for inf sequences
Pad infinity and negative infinity values with spaces when using the
`-w` option to `seq`. This corrects the behavior of `seq` to match that
of the GNU version:

    $ seq -w 1.000 inf inf | head -n 4
    1.000
      inf
      inf
      inf

Previously, it incorrectly padded with 0s instead of spaces.
2021-11-08 20:12:54 -05:00
Thomas Queiroz
124f929848
tests/env: change Windows test_change_directory
Invoke `cmd.exe /C cd` to determine the current working directory instead of relying on the output of
environment variables.
2021-11-07 23:11:39 -03:00
jfinkels
2e12316ae1
seq: use BigDecimal to represent floats (#2698)
* seq: use BigDecimal to represent floats

Use `BigDecimal` to represent arbitrary precision floats in order to
prevent numerical precision issues when iterating over a sequence of
numbers. This commit makes several changes at once to accomplish this
goal.

First, it creates a new struct, `PreciseNumber`, that is responsible for
storing not only the number itself but also the number of digits (both
integer and decimal) needed to display it. This information is collected
at the time of parsing the number, which lives in the new
`numberparse.rs` module.

Second, it uses the `BigDecimal` struct to store arbitrary precision
floating point numbers instead of the previous `f64` primitive
type. This protects against issues of numerical precision when
repeatedly accumulating a very small increment.

Third, since neither the `BigDecimal` nor `BigInt` types have a
representation of infinity, minus infinity, minus zero, or NaN, we add
the `ExtendedBigDecimal` and `ExtendedBigInt` enumerations which extend
the basic types with these concepts.

* fixup! seq: use BigDecimal to represent floats

* fixup! seq: use BigDecimal to represent floats

* fixup! seq: use BigDecimal to represent floats

* fixup! seq: use BigDecimal to represent floats

* fixup! seq: use BigDecimal to represent floats
2021-11-06 15:44:42 +01:00
Hanif Bin Ariffin
7baa05b2db Add tests for silently accepting presume-input-tty
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-11-04 17:04:26 +08:00
Thomas Queiroz
c44b5952b8
tests/env: add unsetting invalid variables test 2021-11-02 19:51:37 -03:00
Michael Debertol
a05628f018
Merge pull request #2731 from thomasqueirozb/env_empty_name
env: don't panic when name is empty
2021-11-02 21:33:42 +01:00
Thomas Queiroz
f9512e5a90
tests/env: add empty name test 2021-11-02 16:45:39 -03:00
Kevin Burke
3e1c5c2d99
rm: allow -r flag to be specified multiple times
GNU rm allows the `-r` flag to be specified multiple times, but
uutils/coreutils would previously exit with an error.

I encountered this while attempting to run `make clean` on the
Postgres source tree (github.com/postgres/postgres).

Updates #1663.
2021-10-28 22:47:07 -07:00
Thomas Queiroz
1d8381064a
tests/uniq: update test 2021-10-24 02:59:50 -03:00
Sylvestre Ledru
610fde45ef
Merge pull request #2709 from jaggededgedjustice/support-symboli-modes
Add symbolic mode support to mkdir
2021-10-23 17:54:15 +02:00
James Robson
0b2483452a Add symbolic mode support to mkdir 2021-10-16 12:57:55 +01:00
Sylvestre Ledru
11ca4be1aa
Merge pull request #2707 from sylvestre/more-clippy
More clippy fixes
2021-10-10 12:46:35 +02:00
Sylvestre Ledru
51613c02ec add a word to ignore... 2021-10-10 12:16:01 +02:00
Sylvestre Ledru
00de952592 Fix various 'if_then_panic' clippy warnings 2021-10-10 09:57:39 +02:00
Jan Scheer
3e985cb029
Merge branch 'master' into fix_chroot_2687 2021-10-10 01:04:25 +02:00
Sylvestre Ledru
03a037e8ea
Merge pull request #2701 from vulppine/seq-hex
seq: Adds hexadecimal integer parsing
2021-10-09 11:01:42 +02:00
vulppine
cddd40b4e1 seq: Updates hex parse readability, adds hex test 2021-10-05 18:41:28 -07:00
vulppine
4e1f945e86 seq: Adds testing for large hex numbers 2021-10-03 09:50:49 -07:00
Thomas Queiroz
f85ccf8e46
tests/base64: update test 2021-10-02 23:16:07 -03:00
Thomas Queiroz
051284de4c
tests/base32: update test 2021-10-02 23:12:42 -03:00
vulppine
aad0682a40 seq: Adds testing for hexadecimal integer parsing 2021-10-02 08:46:09 -07:00
Sylvestre Ledru
b2fa51ddd9
Merge pull request #2656 from jhscheer/ls_selinux
`ls`: add support for showing SELinux context (--context/-Z)
2021-10-02 12:56:09 +02:00
Sylvestre Ledru
01d098993b
Merge pull request #2662 from Smicry/master
add kill -l final new line #2644
2021-09-29 09:58:50 +02:00
Jan Scheer
30c8a43788
test_chroot: add comments 2021-09-22 13:53:57 +02:00
Jan Scheer
8db8d8ac4e
chroot: add 'test_default_shell` 2021-09-19 22:21:29 +02:00
Sylvestre Ledru
8d418cd61c
Merge pull request #2672 from oeble/kill_with_signal_name
Kill with signal name
2021-09-18 22:55:27 +02:00
Sylvestre Ledru
3e8b4045c8
Merge pull request #2675 from blyxxyz/whoami-cleanup
whoami: Cleanup
2021-09-18 17:20:09 +02:00
Jan Verbeek
7ea2bfbe26 seq: replace loops with a single format string
Replace two loops that print leading and trailing 0s when printing a
number in fixed-width mode with a single call to `write!()` with the
appropriate formatting parameters.
2021-09-18 10:27:03 -04:00
Jeffrey Finkelstein
bfb1327ad4 seq: use print_seq_integers() regardless of last
Ensure that the `print_seq_integers()` function is called when the first
number and the increment are integers, regardless of the type of the
last value specified.
2021-09-18 10:27:03 -04:00
Sylvestre Ledru
7fb1fcfac5
Merge pull request #2686 from jfinkels/hashsum-window-text-mode
hashsum: add tests for Windows text mode
2021-09-18 09:16:48 +02:00
Jeffrey Finkelstein
2ac5dc0a70 seq: compute correct width for scientific notation
Change the way `seq` computes the number of digits needed to print a
number so that it works for inputs given in scientific notation.
Specifically, this commit parses the input string to determine whether
it is an integer, a float in decimal notation, or a float in scientific
notation, and then computes the number of integral digits and the number
of fractional digits based on that. This also supports floating point
negative zero, expressed in both decimal and scientific notation.
2021-09-17 23:49:54 -04:00
Jeffrey Finkelstein
cd5f676903 hashsum: add tests for Windows text mode 2021-09-17 21:24:43 -04:00
Jan Scheer
79d838b1c3
Merge branch 'master' into ls_selinux 2021-09-17 14:14:47 +02:00
Smicry
89428a77f3 fix kill list final new line test 2021-09-14 23:56:08 +08:00
Jan Verbeek
0a3785bf84 whoami: Run tests on Windows 2021-09-14 14:13:58 +02:00
Jeffrey Finkelstein
60025800c3 seq: trim leading whitespace from inputs 2021-09-13 21:46:17 -04:00
Michael Debertol
5d7e7ed4c0
Merge pull request #2651 from jhscheer/ls_small_fix_for_test_from_2627
test_ls: add features for uutils called by ccmd
2021-09-13 18:35:32 +02:00