mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-15 04:23:12 +03:00
535aa3193c
Can't reproduce the errors on Azure locally, but hopefully tweaking generated code can get things to work.
20 lines
443 B
Rust
20 lines
443 B
Rust
use wasm_bindgen::prelude::*;
|
|
use wasm_bindgen_test::*;
|
|
|
|
include!(concat!(env!("OUT_DIR"), "/global.rs"));
|
|
|
|
#[wasm_bindgen]
|
|
extern "C" {
|
|
fn get_global() -> Global;
|
|
}
|
|
|
|
#[wasm_bindgen_test]
|
|
fn works() {
|
|
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");
|
|
}
|