(bytes: &[u8])
| 598 | #[test] |
| 599 | fn test_unpack_arithmetic() { |
| 600 | fn test<const FACTOR: usize>(bytes: &[u8]) { |
| 601 | let packed = pack_arithmetic::<FACTOR>(bytes); |
| 602 | |
| 603 | let mut input = packed.as_slice(); |
| 604 | let mut bytes2 = vec![]; |
| 605 | super::unpack_arithmetic::<FACTOR>(&mut input, bytes.len(), &mut bytes2).unwrap(); |
| 606 | assert!(input.is_empty()); |
| 607 | assert_eq!(bytes, bytes2); |
| 608 | } |
| 609 | |
| 610 | test::<2>(&[1, 0, 1, 0]); |
| 611 | test::<2>(&[1, 0, 1, 0, 1, 0, 1, 0]); |