Skip to content
Merged
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
5 changes: 3 additions & 2 deletions src/uu/tail/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,9 @@ impl Settings {
.map(|v| v.map(Input::from).collect())
.unwrap_or_else(|| vec![Input::default()]);

settings.verbose =
settings.inputs.len() > 1 && !matches.get_flag(options::verbosity::QUIET);
settings.verbose = (matches.get_flag(options::verbosity::VERBOSE)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This basically reverts part of the change here 9b49f36
The reason this change got past our testing is that the relevant test was disabled at the time.

|| settings.inputs.len() > 1)
&& !matches.get_flag(options::verbosity::QUIET);

Ok(settings)
}
Expand Down
20 changes: 17 additions & 3 deletions tests/by-util/test_tail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,14 @@ fn test_stdin_explicit() {
}

#[test]
// FIXME: the -f test fails with: Assertion failed. Expected 'tail' to be running but exited with status=exit status: 0
#[ignore = "disabled until fixed"]
#[cfg(not(target_vendor = "apple"))] // FIXME: for currently not working platforms
fn test_stdin_redirect_file() {
// $ echo foo > f

// $ tail < f
// foo

// $ tail -f < f
// $ tail -v < f
// foo
//

Expand All @@ -122,6 +120,22 @@ fn test_stdin_redirect_file() {
.arg("-v")
.succeeds()
.stdout_only("==> standard input <==\nfoo");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear, I've taken the existing test_stdin_redirect_file and split it into 2 separate tests - one test for the -v flag (which with this PR will now pass) and one test for the -f flag (which still fails, but is being tracked with a separate issue #7614).

}

#[test]
// FIXME: the -f test fails with: Assertion failed. Expected 'tail' to be running but exited with status=exit status: 0
#[ignore = "disabled until fixed"]
#[cfg(not(target_vendor = "apple"))] // FIXME: for currently not working platforms
fn test_stdin_redirect_file_follow() {
// $ echo foo > f

// $ tail -f < f
// foo
//

let ts = TestScenario::new(util_name!());
let at = &ts.fixtures;
at.write("f", "foo");

let mut p = ts
.ucmd()
Expand Down
Loading