@@ -705,26 +705,27 @@ impl<T> Iterator for VecIter<T> {
705
705
}
706
706
}
707
707
708
- #[test]
709
- fn ok_vec_buffer_ownership () {
710
- let mut original_array = [1u8 , 2u8 , 3u8 , 4u8 ];
711
- let slice = raw_slice :: from_parts :: <u8 >(__addr_of (original_array ), 4 );
712
-
713
- // Check Vec duplicates the original slice
714
- let mut bytes = Vec :: <u8 >:: from (slice );
715
- bytes . set (0 , 5 );
716
- assert (original_array [0 ] == 1 );
717
-
718
- // At this point, slice equals [5, 2, 3, 4]
719
- let encoded_slice = encode (bytes );
720
-
721
- // `Vec<u8>` should duplicate the underlying buffer,
722
- // so when we write to it, it should not change
723
- // `encoded_slice`
724
- let mut bytes = abi_decode :: <Vec <u8 >>(encoded_slice );
725
- bytes . set (0 , 6 );
726
- assert (bytes . get (0 ) == Some (6 ));
727
-
728
- let mut bytes = abi_decode :: <Vec <u8 >>(encoded_slice );
729
- assert (bytes . get (0 ) == Some (5 ));
730
- }
708
+ // TODO: Uncomment when fixed. https://github.com/FuelLabs/sway/issues/6567
709
+ // #[test]
710
+ // fn ok_vec_buffer_ownership() {
711
+ // let mut original_array = [1u8, 2u8, 3u8, 4u8];
712
+ // let slice = raw_slice::from_parts::<u8>(__addr_of(original_array), 4);
713
+
714
+ // // Check Vec duplicates the original slice
715
+ // let mut bytes = Vec::<u8>::from(slice);
716
+ // bytes.set(0, 5);
717
+ // assert(original_array[0] == 1);
718
+
719
+ // // At this point, slice equals [5, 2, 3, 4]
720
+ // let encoded_slice = encode(bytes);
721
+
722
+ // // `Vec<u8>` should duplicate the underlying buffer,
723
+ // // so when we write to it, it should not change
724
+ // // `encoded_slice`
725
+ // let mut bytes = abi_decode::<Vec<u8>>(encoded_slice);
726
+ // bytes.set(0, 6);
727
+ // assert(bytes.get(0) == Some(6));
728
+
729
+ // let mut bytes = abi_decode::<Vec<u8>>(encoded_slice);
730
+ // assert(bytes.get(0) == Some(5));
731
+ // }
0 commit comments