Skip to content

Commit b1a560e

Browse files
committed
tail: add tests for --debug flag output
1 parent 987aece commit b1a560e

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/by-util/test_tail.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5065,3 +5065,42 @@ fn test_follow_stdout_pipe_close() {
50655065
child.close_stdout();
50665066
child.delay(2000).make_assertion().is_not_alive();
50675067
}
5068+
5069+
#[test]
5070+
fn test_debug_flag_with_polling() {
5071+
let ts = TestScenario::new(util_name!());
5072+
let at = &ts.fixtures;
5073+
at.touch("f");
5074+
5075+
let mut child = ts
5076+
.ucmd()
5077+
.args(&["--debug", "-f", "--use-polling", "f"])
5078+
.run_no_wait();
5079+
5080+
child.make_assertion_with_delay(500).is_alive();
5081+
child
5082+
.kill()
5083+
.make_assertion()
5084+
.with_all_output()
5085+
.stderr_contains("tail: using polling mode");
5086+
}
5087+
5088+
#[test]
5089+
#[cfg(target_os = "linux")]
5090+
fn test_debug_flag_with_inotify() {
5091+
let ts = TestScenario::new(util_name!());
5092+
let at = &ts.fixtures;
5093+
at.touch("f");
5094+
5095+
let mut child = ts
5096+
.ucmd()
5097+
.args(&["--debug", "-f", "f"])
5098+
.run_no_wait();
5099+
5100+
child.make_assertion_with_delay(500).is_alive();
5101+
child
5102+
.kill()
5103+
.make_assertion()
5104+
.with_all_output()
5105+
.stderr_contains("tail: using notification mode");
5106+
}

0 commit comments

Comments
 (0)