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

Function test_primitive_null_offset_nulls

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

Source from the content-addressed store, hash-verified

126
127#[test]
128fn test_primitive_null_offset_nulls() {
129 let b = UInt8Array::from(vec![Some(1), Some(2), Some(3)]).into_data();
130 let b = b.slice(1, 2);
131 let arrays = vec![&b];
132 let mut a = MutableArrayData::new(arrays, true, 2);
133 a.extend(0, 0, 2);
134 a.extend_nulls(3);
135 a.extend(0, 1, 2);
136 let result = a.freeze();
137 let array = UInt8Array::from(result);
138 let expected = UInt8Array::from(vec![Some(2), Some(3), None, None, None, Some(3)]);
139 assert_eq!(array, expected);
140}
141
142#[test]
143fn test_list_null_offset() {

Callers

nothing calls this directly

Calls 5

extend_nullsMethod · 0.80
freezeMethod · 0.80
into_dataMethod · 0.45
sliceMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected