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

Migrate from atty to is-terminal (#4382)

This commit is contained in:
Guilherme A. de Souza 2023-02-21 17:52:18 -03:00 committed by GitHub
parent 4e7ae2d46a
commit 7d7b9eb49a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 161 additions and 70 deletions

View file

@ -1,9 +1,10 @@
use crate::common::util::*;
use is_terminal::IsTerminal;
#[test]
fn test_more_no_arg() {
// Reading from stdin is now supported, so this must succeed
if atty::is(atty::Stream::Stdout) {
if std::io::stdout().is_terminal() {
new_ucmd!().succeeds();
} else {
}
@ -14,7 +15,7 @@ fn test_more_dir_arg() {
// Run the test only if there's a valid terminal, else do nothing
// Maybe we could capture the error, i.e. "Device not found" in that case
// but I am leaving this for later
if atty::is(atty::Stream::Stdout) {
if std::io::stdout().is_terminal() {
new_ucmd!()
.arg(".")
.fails()