File tree 1 file changed +3
-8
lines changed
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ use wasm_bindgen_test::*;
7
7
fn test ( ) {
8
8
let bytes = Int8Array :: new ( & JsValue :: from ( 10 ) ) ;
9
9
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 ) ;
12
11
13
12
let v = DataView :: new ( & bytes. buffer ( ) , 2 , 8 ) ;
14
13
assert_eq ! ( v. byte_offset( ) , 2 ) ;
@@ -63,18 +62,14 @@ fn test() {
63
62
64
63
v. set_int8 ( 0 , 42 ) ;
65
64
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 ) ;
70
66
}
71
67
72
68
#[ wasm_bindgen_test]
73
69
fn dataview_inheritance ( ) {
74
70
let bytes = Int8Array :: new ( & JsValue :: from ( 10 ) ) ;
75
71
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 ) ;
78
73
79
74
let v = DataView :: new ( & bytes. buffer ( ) , 2 , 8 ) ;
80
75
You can’t perform that action at this time.
0 commit comments