1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #5301 from cakebaker/ls_fix_failing_test

ls: fix test which fails if /tmp uses tmpfs
This commit is contained in:
Sylvestre Ledru 2023-09-22 13:24:53 +02:00 committed by GitHub
commit 4094231b89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,7 @@
// //
// For the full copyright and license information, please view the LICENSE // For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code. // file that was distributed with this source code.
// spell-checker:ignore (words) READMECAREFULLY birthtime doesntexist oneline somebackup lrwx somefile somegroup somehiddenbackup somehiddenfile tabsize aaaaaaaa bbbb cccc dddddddd ncccc neee naaaaa nbcdef nfffff dired subdired // spell-checker:ignore (words) READMECAREFULLY birthtime doesntexist oneline somebackup lrwx somefile somegroup somehiddenbackup somehiddenfile tabsize aaaaaaaa bbbb cccc dddddddd ncccc neee naaaaa nbcdef nfffff dired subdired tmpfs
#[cfg(any(unix, feature = "feat_selinux"))] #[cfg(any(unix, feature = "feat_selinux"))]
use crate::common::util::expected_result; use crate::common::util::expected_result;
@ -3608,9 +3608,13 @@ fn test_ls_dired_complex() {
let mut cmd = scene.ucmd(); let mut cmd = scene.ucmd();
cmd.arg("--dired").arg("-l").arg("d"); cmd.arg("--dired").arg("-l").arg("d");
let result = cmd.succeeds(); let result = cmd.succeeds();
// Number of blocks
// Number of blocks. We run this test only if the default size of a newly created directory is
// 4096 bytes to prevent it from failing where this is not the case (e.g. using tmpfs for /tmp).
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
result.stdout_contains(" total 4"); if at.metadata("d/d").len() == 4096 {
result.stdout_contains(" total 4");
}
let output = result.stdout_str().to_string(); let output = result.stdout_str().to_string();
println!("Output:\n{}", output); println!("Output:\n{}", output);