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

wc: better handle files in pseudo-filesystems

This commit is contained in:
zhitkoff 2023-11-26 17:01:22 -05:00 committed by Yury Zhytkou
parent ca024abe31
commit 054ca4a6b5
2 changed files with 29 additions and 5 deletions

View file

@ -419,6 +419,14 @@ fn test_files_from_pseudo_filesystem() {
use pretty_assertions::assert_ne;
let result = new_ucmd!().arg("-c").arg("/proc/cpuinfo").succeeds();
assert_ne!(result.stdout_str(), "0 /proc/cpuinfo\n");
let (at, mut ucmd) = at_and_ucmd!();
let result = ucmd.arg("-c").arg("/sys/kernel/profiling").succeeds();
let actual = at.read("/sys/kernel/profiling").len();
assert_eq!(
result.stdout_str(),
format!("{} /sys/kernel/profiling\n", actual)
);
}
#[test]