Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/more: run all tests with terminal_simulation #6124

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/uu/more/src/more.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use std::{
fs::File,
io::{stdin, stdout, BufReader, Read, Stdout, Write},
io::{stdin, stdout, BufReader, IsTerminal, Read, Stdout, Write},
panic::set_hook,
path::Path,
time::Duration,
Expand Down Expand Up @@ -158,10 +158,10 @@
}
reset_term(&mut stdout);
} else {
stdin().read_to_string(&mut buff).unwrap();
if buff.is_empty() {
if stdin().is_terminal() {
return Err(UUsageError::new(1, "bad usage"));
}
stdin().read_to_string(&mut buff).unwrap();

Check warning on line 164 in src/uu/more/src/more.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/more/src/more.rs#L164

Added line #L164 was not covered by tests
let mut stdout = setup_term();
more(&buff, &mut stdout, false, None, None, &mut options)?;
reset_term(&mut stdout);
Expand Down
Loading
Loading