mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-28 20:21:35 +00:00
Add get/set for TypedArray
s. (#2001)
* Add get/set for `TypedArray`s. * Change names. * Change name to @pauan suggestion.
This commit is contained in:
committed by
GitHub
parent
b6190700c9
commit
7db01a7c7c
@ -89,6 +89,19 @@ fn new_fill() {
|
||||
each!(test_fill);
|
||||
}
|
||||
|
||||
macro_rules! test_get_set {
|
||||
($arr:ident) => {{
|
||||
let arr = $arr::new(&1.into());
|
||||
assert_eq!(arr.get_index(0) as f64, 0 as f64);
|
||||
arr.set_index(0, 1 as _);
|
||||
assert_eq!(arr.get_index(0) as f64, 1 as f64);
|
||||
}};
|
||||
}
|
||||
#[wasm_bindgen_test]
|
||||
fn new_get_set() {
|
||||
each!(test_get_set);
|
||||
}
|
||||
|
||||
macro_rules! test_slice {
|
||||
($arr:ident) => {{
|
||||
let arr = $arr::new(&4.into());
|
||||
|
Reference in New Issue
Block a user