From 6658a0e61027ca8c634d65cca8ddd58828759ed0 Mon Sep 17 00:00:00 2001 From: Valerio <83879763+valerioedu@users.noreply.github.com> Date: Sat, 22 Mar 2025 15:15:28 +0100 Subject: [PATCH] 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 * Apply cargo fmt formatting --------- Co-authored-by: Daniel Hofstetter --- tests/by-util/test_arch.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/by-util/test_arch.rs b/tests/by-util/test_arch.rs index 672d223e0..2486f3d48 100644 --- a/tests/by-util/test_arch.rs +++ b/tests/by-util/test_arch.rs @@ -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" + ); +}