We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1b742bb + e5a2f89 commit 86dc293Copy full SHA for 86dc293
tests/by-util/test_more.rs
@@ -46,14 +46,22 @@ fn test_valid_arg() {
46
47
fn test_alive(args: &[&str]) {
48
let (at, mut ucmd) = at_and_ucmd!();
49
+
50
+ let content = "test content";
51
let file = "test_file";
- at.touch(file);
52
+ at.write(file, content);
53
54
+ let mut cmd = ucmd.args(args).arg(file).run_no_wait();
55
56
+ // wait for more to start and display the file
57
+ while cmd.is_alive() && !cmd.stdout_all().contains(content) {
58
+ cmd.delay(50);
59
+ }
60
61
+ assert!(cmd.is_alive(), "Command should still be alive");
62
- ucmd.args(args)
- .arg(file)
- .run_no_wait()
- .make_assertion()
- .is_alive();
63
+ // cleanup
64
+ cmd.kill();
65
}
66
67
#[test]
0 commit comments