mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
cargo fmt
This commit is contained in:
parent
c00db6da37
commit
81f466fee0
2 changed files with 15 additions and 12 deletions
|
@ -911,14 +911,16 @@ mod cli_tests {
|
||||||
} else {
|
} else {
|
||||||
vec![]
|
vec![]
|
||||||
};
|
};
|
||||||
|
|
||||||
dbg!("pre wasm_run_out");
|
dbg!("pre wasm_run_out");
|
||||||
|
|
||||||
let wasm_run_out =
|
let wasm_run_out = crate::run_wasm_for_cli_test(
|
||||||
crate::run_wasm_for_cli_test(&roc_file_path.with_extension("wasm"), wasm_args.clone());
|
&roc_file_path.with_extension("wasm"),
|
||||||
|
wasm_args.clone(),
|
||||||
|
);
|
||||||
|
|
||||||
dbg!("post wasm_run_out");
|
dbg!("post wasm_run_out");
|
||||||
|
|
||||||
dbg!(&wasm_run_out);
|
dbg!(&wasm_run_out);
|
||||||
assert_eq!(wasm_run_out, expected_output);
|
assert_eq!(wasm_run_out, expected_output);
|
||||||
|
|
||||||
|
@ -1247,11 +1249,11 @@ fn run_wasm_for_cli_test(wasm_path: &std::path::Path, stdin: Vec<&str>) -> Strin
|
||||||
|
|
||||||
Instance::from_bytes(&arena, &wasm_bytes, dispatcher, false).unwrap()
|
Instance::from_bytes(&arena, &wasm_bytes, dispatcher, false).unwrap()
|
||||||
};
|
};
|
||||||
|
|
||||||
dbg!("pre call");
|
dbg!("pre call");
|
||||||
|
|
||||||
let result = instance.call_export("_start", []);
|
let result = instance.call_export("_start", []);
|
||||||
|
|
||||||
dbg!("post call");
|
dbg!("post call");
|
||||||
|
|
||||||
match result {
|
match result {
|
||||||
|
|
|
@ -1008,7 +1008,7 @@ fn build_loaded_file<'a>(
|
||||||
let mut inputs = vec![app_o_file.to_str().unwrap()];
|
let mut inputs = vec![app_o_file.to_str().unwrap()];
|
||||||
|
|
||||||
let mut host_path = String::new();
|
let mut host_path = String::new();
|
||||||
|
|
||||||
match built_host_opt {
|
match built_host_opt {
|
||||||
BuiltHostOpt::Legacy(p) => {
|
BuiltHostOpt::Legacy(p) => {
|
||||||
host_path.push_str(&p.to_string_lossy());
|
host_path.push_str(&p.to_string_lossy());
|
||||||
|
@ -1018,14 +1018,15 @@ fn build_loaded_file<'a>(
|
||||||
// In case of link_type == LinkType::Dylib or target == Target::Wasm32
|
// In case of link_type == LinkType::Dylib or target == Target::Wasm32
|
||||||
// When compiling a Dylib there is no host, such as when generating glue using `roc glue`.
|
// When compiling a Dylib there is no host, such as when generating glue using `roc glue`.
|
||||||
if target == Target::Wasm32 {
|
if target == Target::Wasm32 {
|
||||||
let wasm_host_zig:PathBuf = platform_main_roc_path.with_file_name("host.zig");
|
let wasm_host_zig: PathBuf =
|
||||||
|
platform_main_roc_path.with_file_name("host.zig");
|
||||||
|
|
||||||
assert!(
|
assert!(
|
||||||
wasm_host_zig.exists(),
|
wasm_host_zig.exists(),
|
||||||
"No host.zig file found at {} when building wasm32 target.",
|
"No host.zig file found at {} when building wasm32 target.",
|
||||||
wasm_host_zig.display()
|
wasm_host_zig.display()
|
||||||
);
|
);
|
||||||
|
|
||||||
host_path.push_str(&wasm_host_zig.to_string_lossy());
|
host_path.push_str(&wasm_host_zig.to_string_lossy());
|
||||||
inputs.push(&host_path);
|
inputs.push(&host_path);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue