()
| 397 | |
| 398 | #[test] |
| 399 | fn from_lengths() { |
| 400 | let buffer = OffsetBuffer::<i32>::from_lengths([2, 6, 3, 7, 2]); |
| 401 | assert_eq!(buffer.as_ref(), &[0, 2, 8, 11, 18, 20]); |
| 402 | |
| 403 | let half_max = i32::MAX / 2; |
| 404 | let buffer = OffsetBuffer::<i32>::from_lengths([half_max as usize, half_max as usize]); |
| 405 | assert_eq!(buffer.as_ref(), &[0, half_max, half_max * 2]); |
| 406 | } |
| 407 | |
| 408 | #[test] |
| 409 | #[should_panic(expected = "offset overflow")] |
no outgoing calls
no test coverage detected