mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-25 19:11:45 +03:00
Add a test
This commit is contained in:
parent
ebab7d9fc8
commit
5b66045aff
@ -87,6 +87,12 @@ global.Unforgeable = class Unforgeable {
|
||||
}
|
||||
};
|
||||
|
||||
global.GlobalMethod = class GlobalMethod {
|
||||
constructor() {
|
||||
this.m = () => 123;
|
||||
}
|
||||
};
|
||||
|
||||
global.PartialInterface = class PartialInterface {
|
||||
get un() {
|
||||
return 1;
|
||||
|
@ -62,6 +62,12 @@ fn optional_method() {
|
||||
assert!(f.opt(None) == None);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn global_method() {
|
||||
let f = GlobalMethod::new().unwrap();
|
||||
assert!(f.m() == 123);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn unforgeable_is_structural() {
|
||||
let f = Unforgeable::new().unwrap();
|
||||
|
5
crates/webidl-tests/simple.webidl
vendored
5
crates/webidl-tests/simple.webidl
vendored
@ -35,6 +35,11 @@ interface OptionalMethod {
|
||||
octet? opt(short? a);
|
||||
};
|
||||
|
||||
[Global=GlobalMethod, Constructor()]
|
||||
interface GlobalMethod {
|
||||
octet m();
|
||||
};
|
||||
|
||||
[Constructor()]
|
||||
interface Unforgeable {
|
||||
[Unforgeable] readonly attribute short uno;
|
||||
|
Loading…
Reference in New Issue
Block a user