()
| 93 | |
| 94 | #[test] |
| 95 | fn test_index_ops() { |
| 96 | let array = [255u8, 0u8, 1u8,2u8,3u8,4u8,5u8, 6u8]; |
| 97 | let sl = SliceReference::<u8>::new(&array[..], 1, 5); |
| 98 | let val = sl[0]; |
| 99 | assert_eq!(val, 0); |
| 100 | assert_eq!(&sl[1..5], &[1u8,2u8,3u8,4u8]); |
| 101 | let mut al =ItemVecAllocator::<u64>::default(); |
| 102 | let mut dat = al.alloc_cell(1024); |
| 103 | dat[0] = 0; |
| 104 | dat[1] = 1; |
| 105 | dat[2] = 2; |
| 106 | dat[3] = 3; |
| 107 | assert_eq!(dat[1], 1); |
| 108 | assert_eq!(&dat[1..5], &[1u64,2u64,3u64,0u64]); |
| 109 | assert_eq!(dat.len(), 1024); |
| 110 | al.free_cell(dat); |
| 111 | |
| 112 | } |
nothing calls this directly
no test coverage detected