Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
29
third-party/vendor/wasm-bindgen/tests/wasm/string_vecs.rs
vendored
Normal file
29
third-party/vendor/wasm-bindgen/tests/wasm/string_vecs.rs
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen_test::*;
|
||||
|
||||
#[wasm_bindgen(module = "tests/wasm/string_vecs.js")]
|
||||
extern "C" {
|
||||
fn pass_string_vec();
|
||||
fn pass_invalid_string_vec();
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn consume_string_vec(mut vec: Vec<String>) -> Vec<String> {
|
||||
vec.push("Hello from Rust!".to_owned());
|
||||
vec
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn consume_optional_string_vec(vec: Option<Vec<String>>) -> Option<Vec<String>> {
|
||||
vec.map(consume_string_vec)
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn test_valid() {
|
||||
pass_string_vec();
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn test_invalid() {
|
||||
pass_invalid_string_vec();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue