1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-15 17:51:07 +00:00
uutils-coreutils/tests/by-util/test_arch.rs
Valerio 6658a0e610
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>
2025-03-22 15:15:28 +01:00

32 lines
706 B
Rust

// This file is part of the uutils coreutils package.
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
use crate::common::util::TestScenario;
#[test]
fn test_arch() {
new_ucmd!().succeeds();
}
#[test]
fn test_arch_help() {
new_ucmd!()
.arg("--help")
.succeeds()
.stdout_contains("architecture name");
}
#[test]
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"
);
}