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

Function test_empty_offsets

arrow-array/src/array/string_array.rs:510–528  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

508
509 #[test]
510 fn test_empty_offsets() {
511 let string = StringArray::from(
512 ArrayData::builder(DataType::Utf8)
513 .buffers(vec![Buffer::from(&[]), Buffer::from(&[])])
514 .build()
515 .unwrap(),
516 );
517 assert_eq!(string.len(), 0);
518 assert_eq!(string.value_offsets(), &[0]);
519
520 let string = LargeStringArray::from(
521 ArrayData::builder(DataType::LargeUtf8)
522 .buffers(vec![Buffer::from(&[]), Buffer::from(&[])])
523 .build()
524 .unwrap(),
525 );
526 assert_eq!(string.len(), 0);
527 assert_eq!(string.value_offsets(), &[0]);
528 }
529
530 #[test]
531 fn test_into_builder() {

Callers

nothing calls this directly

Calls 2

buildMethod · 0.45
buffersMethod · 0.45

Tested by

no test coverage detected