File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ use wasm_bindgen_test::*;
77fn test ( ) {
88 let bytes = Int8Array :: new ( & JsValue :: from ( 10 ) ) ;
99
10- // TODO: figure out how to do `bytes[2] = 2`
11- bytes. subarray ( 2 , 3 ) . fill ( 2 , 0 , 1 ) ;
10+ bytes. set_index ( 2 , 2 ) ;
1211
1312 let v = DataView :: new ( & bytes. buffer ( ) , 2 , 8 ) ;
1413 assert_eq ! ( v. byte_offset( ) , 2 ) ;
@@ -63,18 +62,14 @@ fn test() {
6362
6463 v. set_int8 ( 0 , 42 ) ;
6564
66- // TODO: figure out how to do `bytes[2]`
67- bytes
68- . subarray ( 2 , 3 )
69- . for_each ( & mut |x, _, _| assert_eq ! ( x, 42 ) ) ;
65+ assert_eq ! ( bytes. get_index( 2 ) , 42 ) ;
7066}
7167
7268#[ wasm_bindgen_test]
7369fn dataview_inheritance ( ) {
7470 let bytes = Int8Array :: new ( & JsValue :: from ( 10 ) ) ;
7571
76- // TODO: figure out how to do `bytes[2] = 2`
77- bytes. subarray ( 2 , 3 ) . fill ( 2 , 0 , 1 ) ;
72+ bytes. set_index ( 2 , 2 ) ;
7873
7974 let v = DataView :: new ( & bytes. buffer ( ) , 2 , 8 ) ;
8075
You can’t perform that action at this time.
0 commit comments