Skip to content

Commit 070bbe2

Browse files
committed
Fix tests
1 parent 51b2211 commit 070bbe2

File tree

1 file changed

+16
-25
lines changed

1 file changed

+16
-25
lines changed

tests/by-util/test_stat.rs

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,10 @@ fn test_pipe_fifo() {
256256
let (at, mut ucmd) = at_and_ucmd!();
257257
at.mkfifo("FIFO");
258258
ucmd.arg("FIFO")
259-
.run()
259+
.succeeds()
260260
.no_stderr()
261261
.stdout_contains("fifo")
262-
.stdout_contains("File: FIFO")
263-
.succeeded();
262+
.stdout_contains("File: FIFO");
264263
}
265264

266265
#[test]
@@ -275,19 +274,17 @@ fn test_stdin_pipe_fifo1() {
275274
new_ucmd!()
276275
.arg("-")
277276
.set_stdin(std::process::Stdio::piped())
278-
.run()
277+
.succeeds()
279278
.no_stderr()
280279
.stdout_contains("fifo")
281-
.stdout_contains("File: -")
282-
.succeeded();
280+
.stdout_contains("File: -");
283281
new_ucmd!()
284282
.args(&["-L", "-"])
285283
.set_stdin(std::process::Stdio::piped())
286-
.run()
284+
.succeeds()
287285
.no_stderr()
288286
.stdout_contains("fifo")
289-
.stdout_contains("File: -")
290-
.succeeded();
287+
.stdout_contains("File: -");
291288
}
292289

293290
#[test]
@@ -299,11 +296,10 @@ fn test_stdin_pipe_fifo2() {
299296
new_ucmd!()
300297
.arg("-")
301298
.set_stdin(std::process::Stdio::null())
302-
.run()
299+
.succeeds()
303300
.no_stderr()
304301
.stdout_contains("character special file")
305-
.stdout_contains("File: -")
306-
.succeeded();
302+
.stdout_contains("File: -");
307303
}
308304

309305
#[test]
@@ -339,11 +335,10 @@ fn test_stdin_redirect() {
339335
ts.ucmd()
340336
.arg("-")
341337
.set_stdin(std::fs::File::open(at.plus("f")).unwrap())
342-
.run()
338+
.succeeds()
343339
.no_stderr()
344340
.stdout_contains("regular empty file")
345-
.stdout_contains("File: -")
346-
.succeeded();
341+
.stdout_contains("File: -");
347342
}
348343

349344
#[test]
@@ -361,17 +356,13 @@ fn test_quoting_style_locale() {
361356
ts.ucmd()
362357
.env("QUOTING_STYLE", "locale")
363358
.args(&["-c", "%N", "'"])
364-
.run()
365-
.no_stderr()
366-
.stdout_is("'\\''\n")
367-
.succeeded();
359+
.succeeds()
360+
.stdout_only("'\\''\n");
368361

369362
ts.ucmd()
370363
.args(&["-c", "%N", "'"])
371-
.run()
372-
.no_stderr()
373-
.stdout_is("\"'\"\n")
374-
.succeeded();
364+
.succeeds()
365+
.stdout_only("\"'\"\n");
375366
}
376367

377368
#[test]
@@ -395,11 +386,11 @@ fn test_printf_octal_2() {
395386
}
396387

397388
#[test]
398-
fn test_printf_hex_3() {
389+
fn test_printf_incomplete_hex() {
399390
let ts = TestScenario::new(util_name!());
400391
ts.ucmd()
401392
.args(&["--printf=\\x", "."])
402-
.run()
393+
.succeeds()
403394
.stderr_contains("warning: incomplete hex escape");
404395
}
405396

0 commit comments

Comments
 (0)