Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2b81c8b

Browse files
committedSep 4, 2024·
Move pipe related test cases into one
to avoid setting pipefail flags concurrently
1 parent 8090c39 commit 2b81c8b

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed
 

‎tests/test_macros.rs

+8-10
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ fn test_pipe() {
150150

151151
let wc_cmd = "wc";
152152
assert!(run_cmd!(ls | $wc_cmd).is_ok());
153+
154+
// test pipefail
155+
assert!(run_cmd!(false | true).is_err());
156+
assert!(run_fun!(false | true).is_err());
157+
assert!(run_fun!(ignore false | true).is_ok());
158+
set_pipefail(false);
159+
assert!(run_fun!(ignore false | true).is_ok());
160+
set_pipefail(true);
153161
}
154162

155163
#[test]
@@ -255,13 +263,3 @@ fn test_empty_arg() {
255263
let opt = "";
256264
assert!(run_cmd!(ls $opt).is_ok());
257265
}
258-
259-
#[test]
260-
fn test_pipefail_in_fun() {
261-
assert!(run_cmd!(false | true).is_err());
262-
assert!(run_fun!(false | true).is_err());
263-
assert!(run_fun!(ignore false | true).is_ok());
264-
set_pipefail(false);
265-
assert!(run_fun!(ignore false | true).is_ok());
266-
set_pipefail(true);
267-
}

0 commit comments

Comments
 (0)
Please sign in to comment.