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
co-authored by Daniel Hofstetter
parent a64fce8286
commit 6658a0e610
+9
View File
@@ -21,3 +21,12 @@ fn test_arch_help() {
fn test_invalid_arg() {
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"
);
}