mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-29 20:51:37 +00:00
Fix webidl-tests fallout
This commit is contained in:
@ -1,13 +1,20 @@
|
||||
use js_sys::Object;
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen_test::*;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/global.rs"));
|
||||
|
||||
#[wasm_bindgen]
|
||||
extern {
|
||||
fn get_global() -> Global;
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn works() {
|
||||
assert_eq!(Global::global_no_args(), 3);
|
||||
assert_eq!(Global::global_with_args("a", "b"), "ab");
|
||||
assert_eq!(Global::global_attribute(), "x");
|
||||
Global::set_global_attribute("y");
|
||||
assert_eq!(Global::global_attribute(), "y");
|
||||
let x = get_global();
|
||||
assert_eq!(x.global_no_args(), 3);
|
||||
assert_eq!(x.global_with_args("a", "b"), "ab");
|
||||
assert_eq!(x.global_attribute(), "x");
|
||||
x.set_global_attribute("y");
|
||||
assert_eq!(x.global_attribute(), "y");
|
||||
}
|
||||
|
Reference in New Issue
Block a user