Vendor dependencies
Let's see how I like this workflow.
This commit is contained in:
parent
34d1830413
commit
9c435dc440
7500 changed files with 1665121 additions and 99 deletions
40
vendor/wasm-bindgen/tests/wasm/final.rs
vendored
Normal file
40
vendor/wasm-bindgen/tests/wasm/final.rs
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen_test::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
type Math;
|
||||
#[wasm_bindgen(static_method_of = Math, final)]
|
||||
fn log(f: f32) -> f32;
|
||||
}
|
||||
|
||||
#[wasm_bindgen(module = "tests/wasm/final.js")]
|
||||
extern "C" {
|
||||
type MyType;
|
||||
#[wasm_bindgen(constructor, final)]
|
||||
fn new(x: u32) -> MyType;
|
||||
#[wasm_bindgen(static_method_of = MyType, final)]
|
||||
fn foo(a: &str) -> String;
|
||||
#[wasm_bindgen(method, final)]
|
||||
fn bar(this: &MyType, arg: bool) -> f32;
|
||||
|
||||
#[wasm_bindgen(method, getter, final)]
|
||||
fn a(this: &MyType) -> u32;
|
||||
#[wasm_bindgen(method, setter, final)]
|
||||
fn set_a(this: &MyType, a: u32);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn simple() {
|
||||
assert_eq!(Math::log(1.0), 0.0);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn classes() {
|
||||
assert_eq!(MyType::foo("x"), "xy");
|
||||
let x = MyType::new(2);
|
||||
assert_eq!(x.bar(true), 3.2);
|
||||
assert_eq!(x.a(), 1);
|
||||
x.set_a(3);
|
||||
assert_eq!(x.a(), 3);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue