Skip to content

Commit 97e9e7c

Browse files
committed
assert output in test_wasm_api_function
1 parent 0121fd4 commit 97e9e7c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/engine.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use wasmtime_wasi::preview1::WasiP1Ctx;
88
use wasmtime_wasi::{I32Exit, WasiCtxBuilder};
99

1010
use crate::codec::Codec;
11-
use crate::function_run_result::FunctionRunResult;
11+
use crate::function_run_result::{FunctionRunResult, FunctionOutput};
1212
#[derive(Clone)]
1313
pub struct ProfileOpts {
1414
pub interval: u32,
@@ -403,7 +403,8 @@ mod tests {
403403

404404
#[test]
405405
fn test_wasm_api_function() {
406-
let input = json!({"test": "echo"}).to_string().into_bytes();
406+
let expected_input_value = json!({"foo": "echo", "bar": "test"});
407+
let input = expected_input_value.to_string().into_bytes();
407408
let function_run_result = run(FunctionRunParams {
408409
function_path: Path::new("tests/fixtures/build/echo.trampolined.wasm").to_path_buf(),
409410
input,
@@ -412,5 +413,6 @@ mod tests {
412413
});
413414

414415
assert!(function_run_result.is_ok());
416+
assert_eq!(function_run_result.unwrap().input, expected_input_value);
415417
}
416418
}

0 commit comments

Comments
 (0)