Rust编写的JavaScript引擎,该项目是一个试验性质的项目。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

27 lines
552 B

#![expect(
unused_crate_dependencies,
reason = "https://github.com/rust-lang/rust/issues/95513"
)]
#![cfg(all(
any(target_arch = "wasm32", target_arch = "wasm64"),
target_os = "unknown"
))]
use wasm_bindgen_test::*;
wasm_bindgen_test_configure!(run_in_browser);
#[wasm_bindgen_test]
fn simple() {
const CODE: &str = r"
function greet(targetName) {
return 'Hello, ' + targetName + '!';
}
greet('World')
";
let result = boa_wasm::evaluate(CODE).unwrap();
assert_eq!(result, "\"Hello, World!\"");
}