added tests for SharedArrayBuffer

This commit is contained in:
ibaryshnikov
2019-04-26 10:59:06 +08:00
parent 7e512ba187
commit af22a26880
4 changed files with 65 additions and 2 deletions

View File

@ -22,14 +22,14 @@ fn is_view() {
assert!(ArrayBuffer::is_view(&JsValue::from(x)));
}
#[test]
#[wasm_bindgen_test]
fn slice() {
let buf = ArrayBuffer::new(4);
let slice = buf.slice(2);
assert!(JsValue::from(slice).is_object());
}
#[test]
#[wasm_bindgen_test]
fn slice_with_end() {
let buf = ArrayBuffer::new(4);
let slice = buf.slice_with_end(1, 2);