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.
 
 

19 lines
382 B

#![allow(unused_crate_dependencies)]
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!\"");
}