41 lines
1.1 KiB
Rust
41 lines
1.1 KiB
Rust
use super::*;
|
|
|
|
#[test]
|
|
fn parallel_executes_concurrent_polling_error_order_borrows_moves_and_cancellation() {
|
|
for profile in [Profile::Dev, Profile::Release] {
|
|
let binary = build(
|
|
"parallel",
|
|
include_str!("parallel.dever"),
|
|
Some(include_str!("parallel.rs.txt")),
|
|
profile,
|
|
);
|
|
let output = Command::new(binary).output().unwrap();
|
|
assert!(
|
|
output.status.success(),
|
|
"{}",
|
|
String::from_utf8_lossy(&output.stderr)
|
|
);
|
|
}
|
|
}
|
|
|
|
#[test]
|
|
fn parallel_cmd_executes_the_checked_group() {
|
|
let binary = build(
|
|
"parallel-command",
|
|
include_str!("parallel.dever"),
|
|
None,
|
|
Profile::Dev,
|
|
);
|
|
let output = Command::new(binary)
|
|
.args(["main.main.together", "{}"])
|
|
.output()
|
|
.unwrap();
|
|
assert!(
|
|
output.status.success(),
|
|
"{}",
|
|
String::from_utf8_lossy(&output.stderr)
|
|
);
|
|
let value: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap();
|
|
assert_eq!(value["data"], serde_json::json!({"left":11,"right":22}));
|
|
}
|