2018-08-06 21:46:23 +03:00
|
|
|
use wasm_bindgen::prelude::*;
|
2018-09-26 18:26:00 +03:00
|
|
|
use wasm_bindgen_test::*;
|
2018-08-06 21:46:23 +03:00
|
|
|
|
|
|
|
#[wasm_bindgen(module = "tests/wasm/comments.js")]
|
2018-09-26 18:26:00 +03:00
|
|
|
extern "C" {
|
2018-08-06 21:46:23 +03:00
|
|
|
fn assert_comments_exist();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[wasm_bindgen]
|
|
|
|
/// annotated function
|
|
|
|
pub fn annotated() -> String {
|
|
|
|
String::new()
|
|
|
|
}
|
|
|
|
|
|
|
|
#[wasm_bindgen]
|
|
|
|
/// annotated struct type
|
|
|
|
pub struct Annotated {
|
|
|
|
a: String,
|
|
|
|
/// annotated struct field
|
2018-09-26 18:26:00 +03:00
|
|
|
pub b: u32,
|
2018-08-06 21:46:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[wasm_bindgen]
|
|
|
|
impl Annotated {
|
|
|
|
/// annotated struct method
|
|
|
|
pub fn get_a(&self) -> String {
|
|
|
|
self.a.clone()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[wasm_bindgen_test]
|
|
|
|
fn works() {
|
|
|
|
assert_comments_exist();
|
|
|
|
}
|