MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_iter_unaligned

Function test_iter_unaligned

arrow-buffer/src/util/bit_chunk_iterator.rs:415–433  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 2

bit_chunksMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected