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

Function from_lengths

arrow-buffer/src/buffer/offset.rs:399–406  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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")]

Callers 15

criterion_benchmarkFunction · 0.85
b64_encodeFunction · 0.85
test_cast_list_to_fslFunction · 0.85
make_list_arrayFunction · 0.85
make_large_list_arrayFunction · 0.85
test_list_to_stringFunction · 0.85
nestedFunction · 0.85
generate_listFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected