()
| 413 | |
| 414 | #[test] |
| 415 | fn test_iter_unaligned() { |
| 416 | let input: &[u8] = &[ |
| 417 | 0b00000000, 0b00000001, 0b00000010, 0b00000100, 0b00001000, 0b00010000, 0b00100000, |
| 418 | 0b01000000, 0b11111111, |
| 419 | ]; |
| 420 | let buffer: Buffer = Buffer::from(input); |
| 421 | |
| 422 | let bitchunks = buffer.bit_chunks(4, 64); |
| 423 | |
| 424 | assert_eq!(0, bitchunks.remainder_len()); |
| 425 | assert_eq!(0, bitchunks.remainder_bits()); |
| 426 | |
| 427 | let result = bitchunks.into_iter().collect::<Vec<_>>(); |
| 428 | |
| 429 | assert_eq!( |
| 430 | vec![0b1111010000000010000000010000000010000000010000000010000000010000], |
| 431 | result |
| 432 | ); |
| 433 | } |
| 434 | |
| 435 | #[test] |
| 436 | fn test_iter_unaligned_remainder_1_byte() { |
nothing calls this directly
no test coverage detected