From: Ian Jackson Date: Mon, 31 May 2021 13:38:03 +0000 (+0100) Subject: childio: tests: Break out ENDING X-Git-Tag: otter-0.7.0~196 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=4732789f706ac8f643798b56d533fc63c2507a80;p=otter.git childio: tests: Break out ENDING Signed-off-by: Ian Jackson --- diff --git a/src/childio.rs b/src/childio.rs index 3e663c0e..0da81c9c 100644 --- a/src/childio.rs +++ b/src/childio.rs @@ -177,6 +177,8 @@ fn t_cat() { #[test] fn t_false() { + static ENDING: &str = "exit status: 1"; + let setup = ||{ let c = Command::new("false"); run_pair(c, "cat".into()).unwrap() @@ -189,7 +191,7 @@ fn t_false() { let e = r.unwrap_err(); assert_eq!( e.kind(), ErrorKind::Other ); let es = e.to_string(); - assert!( es.ends_with("exit status: 1"), "actually {:?}", es ); + assert!( es.ends_with(ENDING), "actually {:?}", es ); }; one(&|_w, r|{