mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-21 20:22:14 +00: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 {
|
global.PartialInterface = class PartialInterface {
|
||||||
get un() {
|
get un() {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -62,6 +62,12 @@ fn optional_method() {
|
|||||||
assert!(f.opt(None) == None);
|
assert!(f.opt(None) == None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen_test]
|
||||||
|
fn global_method() {
|
||||||
|
let f = GlobalMethod::new().unwrap();
|
||||||
|
assert!(f.m() == 123);
|
||||||
|
}
|
||||||
|
|
||||||
#[wasm_bindgen_test]
|
#[wasm_bindgen_test]
|
||||||
fn unforgeable_is_structural() {
|
fn unforgeable_is_structural() {
|
||||||
let f = Unforgeable::new().unwrap();
|
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);
|
octet? opt(short? a);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[Global=GlobalMethod, Constructor()]
|
||||||
|
interface GlobalMethod {
|
||||||
|
octet m();
|
||||||
|
};
|
||||||
|
|
||||||
[Constructor()]
|
[Constructor()]
|
||||||
interface Unforgeable {
|
interface Unforgeable {
|
||||||
[Unforgeable] readonly attribute short uno;
|
[Unforgeable] readonly attribute short uno;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user