Skip to content
Merged
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
20 changes: 14 additions & 6 deletions tests/by-util/test_more.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,22 @@ fn test_valid_arg() {

fn test_alive(args: &[&str]) {
let (at, mut ucmd) = at_and_ucmd!();

let content = "test content";
let file = "test_file";
at.touch(file);
at.write(file, content);

let mut cmd = ucmd.args(args).arg(file).run_no_wait();

// wait for more to start and display the file
while cmd.is_alive() && !cmd.stdout_all().contains(content) {
cmd.delay(50);
}

assert!(cmd.is_alive(), "Command should still be alive");

ucmd.args(args)
.arg(file)
.run_no_wait()
.make_assertion()
.is_alive();
// cleanup
cmd.kill();
}

#[test]
Expand Down
Loading