Daniel Hofstetter
7f70bfad30
du: fix "function never used" warning in test
2025-05-19 11:18:02 +02:00
Ben Wiederhake
d6e78d738d
du: test existing correct behavior: warn about --inodes -b conflict
2025-04-18 16:21:24 +02:00
Ben Wiederhake
a82dce0bd7
du: don't panic on block-size 0
2025-04-12 22:51:09 +02:00
Daniel Hofstetter
a77e218a79
Merge pull request #7690 from nyurik/manual-inline
...
chore: manual inline formatting - tests
2025-04-08 15:27:14 +02:00
Yuri Astrakhan
3dc771924c
chore: cleanup trailing commas before parens
...
Deleted commas in cases like `foo,)` -- mostly in macros
2025-04-08 00:33:58 -04:00
Yuri Astrakhan
982805d3cd
chore: manual inline formatting
...
Minor manual cleanup - inlined many format args. This makes the code a bit more readable, and helps spot a few inefficiencies and possible bugs. Note that `&foo` in a `format!` parameter results in a 6% extra performance cost, and does not get inlined by the compiler (yet).
2025-04-08 00:23:21 -04:00
Sylvestre Ledru
a0179ea239
uutests: adjust the tests to use them
2025-03-28 21:40:31 +01:00
Sylvestre Ledru
a85539f530
Run cargo fmt on the tree
2025-03-24 21:33:12 +01:00
Sylvestre Ledru
18cb7dcf9e
Use the new function fails_with_code
...
Done with
```
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.no_stdout\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2)\n\1.no_stdout();/gs' *rs
$ sed -i -e "s|.fails()(.*).code_is(|.fails_with_code(|g" *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2);/gs' *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)(.*?)[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\3)\2;/gs' *rs
...
```
2025-03-01 17:26:20 +01:00
sreehari prasad
c2505841e0
Tests: provides easy mount of temp fs ( #7249 )
2025-02-01 19:01:49 +01:00
Sylvestre Ledru
95bd50e09a
du: deduplicate the input
...
Should fix:
tests/du/hard-link.sh
2024-11-29 10:26:27 +01:00
Sylvestre Ledru
8df608cf97
clippy: used underscore-prefixed item
2024-11-29 08:36:54 +01:00
Sylvestre Ledru
1b2778b819
du: fix the size display with --inodes
2024-11-20 16:13:54 -05:00
Sylvestre Ledru
76d14ed484
du: fix the count with --inodes
2024-11-20 16:13:52 -05:00
Laurent Cheylus
008dd38a0d
tests: fix warnings on OpenBSD for unused imports in by-util/test_*
...
Signed-off-by: Laurent Cheylus <foxy@free.fr>
2024-07-06 22:45:10 +02:00
Laurent Cheylus
584a9d290f
tests: disable failed tests for du on OpenBSD
...
Signed-off-by: Laurent Cheylus <foxy@free.fr>
2024-07-06 22:29:16 +02:00
n4n5
ab67947321
fix clippy tests
2024-06-30 16:27:08 +02:00
Daniel Hofstetter
a816960c33
tests: remove 'target_pointer_width = "128"'
2024-05-20 23:27:53 +02:00
Daniel Hofstetter
89af8b9769
du,uucore: add words to spell-checker:ignore
2024-04-24 16:54:32 +02:00
Michael Vogt
61e0450c66
du: give -h
output the same precision as GNU coreutils
...
When printing the `du -h` output GNU coreutils does autoscale
the size, e.g.
```
$ truncate -s12M a
$ truncate -s8500 b
$ truncate -s133456345 c
$ truncate -s56990456345 d
$ du -h --apparent-size a b c d
12M a
8,4K b
128M c
54G d
```
Align our version to do the same by sharing the code with `ls`.
Closes : #6159
2024-04-24 16:53:08 +02:00
Ben Wiederhake
27a81f3d32
du: accept shortcuts for stringly-enum arguments
2024-04-14 15:39:46 +02:00
Carbrex
49c7e65f5d
Use time-style only if time is provided
2024-04-01 17:09:59 +02:00
Daniel Hofstetter
d1e1e9ce0f
du: adapt error msg to match GNU's
2024-01-30 10:08:50 +01:00
Daniel Hofstetter
e4fbc31714
du: ignore duplicate names with --files0-from
2024-01-03 09:39:16 +01:00
Daniel Hofstetter
239e5426e6
du: show error for nul names with --files0-from
2024-01-02 16:06:41 +01:00
Daniel Hofstetter
2d260ded58
du: use concat! to improve readability in tests
2023-12-26 15:19:45 +01:00
Daniel Hofstetter
37c83ec480
du: simplify file creation in tests
2023-12-26 15:15:02 +01:00
Sylvestre Ledru
30eb77ac79
du: implement files0-from ( #5721 )
...
* du: implement files0-from
Should make tests/du/files0-from-dir pass
* du: prepare tests/du/files0-from.pl
* fix the build on Windows
* add testfile to the ignore list
* remove useless comment
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
* mkdir is enough
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
* address review comments
---------
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-12-26 14:40:31 +01:00
Sylvestre Ledru
6d2486c096
Merge pull request #5503 from cakebaker/du_unused_du_basics
...
du: call unused _du_basics() in test_du_basics()
2023-12-25 22:38:27 +01:00
Daniel Hofstetter
030fd3d4d2
du: test behavior with POSIXLY_CORRECT set
2023-12-25 13:17:17 +01:00
Daniel Hofstetter
c111dc88ac
du: fix issue with dereference in test
2023-12-08 10:23:15 +01:00
Daniel Hofstetter
49fb72ed21
du: disable test on Android
2023-12-03 14:07:03 +01:00
Daniel Hofstetter
4903b91973
du: call unused _du_basics() in test_du_basics()
2023-12-02 16:52:12 +01:00
Daniel Hofstetter
12e61d451c
du: make -l/--count-links work
2023-11-09 16:07:02 +01:00
Daniel Hofstetter
7afb8461cb
du: add -H (alias for --dereference-args)
2023-11-07 10:30:54 +01:00
Daniel Hofstetter
bbdde2890a
du: ignore test under Android & FreeBSD
2023-11-05 14:27:20 +01:00
Daniel Hofstetter
29f6631554
du: add -P/--no-dereference
2023-11-03 17:17:44 +01:00
Terts Diepraam
c3f9e19a3b
all: normalize license notice in all *.rs files
2023-08-24 12:21:09 +02:00
Daniel Hofstetter
c99d81a05b
du: fix "unused import" warning on Windows
2023-06-27 15:05:27 +02:00
John Shin
b34e7f7bf6
du: directories have apparent size of 0
2023-06-25 15:56:57 -07:00
Daniel Hofstetter
7730c8171d
du: fix clippy warning in test
2023-04-21 17:01:40 +02:00
Sylvestre Ledru
47cb40c020
du: adjust test_du_basics_bad_name as we made it work
2023-04-13 13:27:04 +02:00
Sylvestre Ledru
eea8d40e78
du: add support of --dereference-args
...
Should fix tests/du/deref.sh
2023-04-13 13:27:04 +02:00
Sylvestre Ledru
5a1d9cec7e
du: an error code when done on a non existing file
2023-04-13 13:27:04 +02:00
Maciej Habasiński
d277603bf1
du: fmt fix
2023-03-26 23:38:31 +02:00
Maciej Habasiński
892f1d910a
test: du invalid threshold
2023-03-26 15:08:56 +02:00
Daniel Hofstetter
0140f4f7d0
tests: fix "unresolved import" warnings on Windows
2023-03-20 16:26:31 +01:00
Daniel Hofstetter
6988eb7ec6
tests: expand wildcard imports
2023-03-20 15:32:35 +01:00
Koki Ueha
0b042f0b32
test_du: fix unnecessary boolean operation
2023-03-19 04:59:08 +00:00
Guilherme Gonçalves
d29119728a
tests/du: run test_du_time with TZ=UTC.
...
du --time formats a file's timestamp according to the local timezone,
but the test implicitly assumed UTC. This caused it to fail when
running locally in my UTC+1 machine.
$ cargo test --features "du touch" --no-default-features
Failure: https://gist.github.com/eggpi/651e01559b7c59e9457c1b22fe4c0c19
2023-03-02 22:14:03 +00:00