Skip to content

Commit 55a4285

Browse files
committed
timeout: use no_output() to simplify tests
1 parent df91808 commit 55a4285

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

tests/by-util/test_timeout.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,11 @@ fn test_zero_timeout() {
6565
new_ucmd!()
6666
.args(&["-v", "0", "sleep", ".1"])
6767
.succeeds()
68-
.no_stderr()
69-
.no_stdout();
68+
.no_output();
7069
new_ucmd!()
7170
.args(&["-v", "0", "-s0", "-k0", "sleep", ".1"])
7271
.succeeds()
73-
.no_stderr()
74-
.no_stdout();
72+
.no_output();
7573
}
7674

7775
#[test]
@@ -101,8 +99,7 @@ fn test_preserve_status() {
10199
.fails()
102100
// 128 + SIGTERM = 128 + 15
103101
.code_is(128 + 15)
104-
.no_stderr()
105-
.no_stdout();
102+
.no_output();
106103
}
107104
}
108105

@@ -115,8 +112,7 @@ fn test_preserve_status_even_when_send_signal() {
115112
.args(&["-s", cont_spelling, "--preserve-status", ".1", "sleep", "2"])
116113
.succeeds()
117114
.code_is(0)
118-
.no_stderr()
119-
.no_stdout();
115+
.no_output();
120116
}
121117
}
122118

@@ -126,14 +122,12 @@ fn test_dont_overflow() {
126122
.args(&["9223372036854775808d", "sleep", "0"])
127123
.succeeds()
128124
.code_is(0)
129-
.no_stderr()
130-
.no_stdout();
125+
.no_output();
131126
new_ucmd!()
132127
.args(&["-k", "9223372036854775808d", "10", "sleep", "0"])
133128
.succeeds()
134129
.code_is(0)
135-
.no_stderr()
136-
.no_stdout();
130+
.no_output();
137131
}
138132

139133
#[test]
@@ -166,8 +160,7 @@ fn test_kill_after_long() {
166160
new_ucmd!()
167161
.args(&["--kill-after=1", "1", "sleep", "0"])
168162
.succeeds()
169-
.no_stdout()
170-
.no_stderr();
163+
.no_output();
171164
}
172165

173166
#[test]

0 commit comments

Comments
 (0)