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

Add test to ensure arch output is not empty (#7523)

* Add test to ensure arch output is not empty

This test ensures that the output of the arch command is non-empty, which is a minimal expectation across all supported architectures.

This helps avoid regressions or edge cases where the command might unexpectedly return an empty string on unsupported or misconfigured platforms.

* Update tests/by-util/test_arch.rs

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* Apply cargo fmt formatting

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
This commit is contained in:
Valerio 2025-03-22 15:15:28 +01:00 committed by GitHub
parent a64fce8286
commit 6658a0e610
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,3 +21,12 @@ fn test_arch_help() {
fn test_invalid_arg() { fn test_invalid_arg() {
new_ucmd!().arg("--definitely-invalid").fails_with_code(1); new_ucmd!().arg("--definitely-invalid").fails_with_code(1);
} }
#[test]
fn test_arch_output_is_not_empty() {
let result = new_ucmd!().succeeds();
assert!(
!result.stdout_str().trim().is_empty(),
"arch output was empty"
);
}