use std::path::PathBuf;
use std::process::Command;
#[test]
fn map_locals_compile_and_keep_other_bindings_of_their_name() {
let tish = PathBuf::from(env!("CARGO_BIN_EXE_tish"));
let src = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("tests/fixtures/map_local_direct_dispatch.tish");
let dir = tempfile::tempdir().expect("tempdir");
let bin = dir.path().join("map_local_direct_dispatch");
let build = Command::new(&tish)
.args(["build", "--target", "native", "-o"])
.arg(&bin)
.arg(&src)
.output()
.expect("spawn tish build");
assert!(
build.status.success(),
"native build failed:\n{}",
String::from_utf8_lossy(&build.stderr)
);
let out = Command::new(&bin).output().expect("run the built binary");
assert!(
out.status.success(),
"{}",
String::from_utf8_lossy(&out.stderr)
);
assert_eq!(
String::from_utf8_lossy(&out.stdout),
"true true 1 2 1 -1 2 1\n1 param k object k\n2/false\n"
);
}