From 1a12ffaa796e3d57d90a784ff3d276b5e4ae335c Mon Sep 17 00:00:00 2001 From: Ideflop Date: Thu, 18 May 2023 09:18:33 +0200 Subject: [PATCH] Add check for terminal in test_valid_arg() function --- tests/by-util/test_more.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/by-util/test_more.rs b/tests/by-util/test_more.rs index 5b4fa1ca3..80d3c3da4 100644 --- a/tests/by-util/test_more.rs +++ b/tests/by-util/test_more.rs @@ -12,11 +12,14 @@ fn test_more_no_arg() { #[test] fn test_valid_arg() { - new_ucmd!().arg("-c").succeeds().code_is(0); - new_ucmd!().arg("--print-over").succeeds().code_is(0); + if std::io::stdout().is_terminal() { + new_ucmd!().arg("-c").succeeds().code_is(0); + new_ucmd!().arg("--print-over").succeeds().code_is(0); - new_ucmd!().arg("-p").succeeds().code_is(0); - new_ucmd!().arg("--clean-print").succeeds().code_is(0); + new_ucmd!().arg("-p").succeeds().code_is(0); + new_ucmd!().arg("--clean-print").succeeds().code_is(0); + } else { + } } #[test]