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

Function test_extend_nulls

arrow/tests/array_transform.rs:1009–1021  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1007
1008#[test]
1009fn test_extend_nulls() {
1010 let int = Int32Array::from(vec![1, 2, 3, 4]).into_data();
1011 let mut mutable = MutableArrayData::new(vec![&int], true, 4);
1012 mutable.extend(0, 2, 3);
1013 mutable.extend_nulls(2);
1014
1015 let data = mutable.freeze();
1016 data.validate_full().unwrap();
1017 let out = Int32Array::from(data);
1018
1019 assert_eq!(out.null_count(), 2);
1020 assert_eq!(out.iter().collect::<Vec<_>>(), vec![Some(3), None, None]);
1021}
1022
1023#[test]
1024#[should_panic(expected = "MutableArrayData not nullable")]

Callers

nothing calls this directly

Calls 5

extend_nullsMethod · 0.80
freezeMethod · 0.80
validate_fullMethod · 0.80
into_dataMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected