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

Function test_variable_sized_offsets

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

Source from the content-addressed store, hash-verified

188/// with an offset and nulls
189#[test]
190fn test_variable_sized_offsets() {
191 let array = StringArray::from(vec![Some("a"), Some("bc"), None, Some("defh")]);
192 let array = array.into_data().slice(1, 3);
193
194 let arrays = vec![&array];
195
196 let mut mutable = MutableArrayData::new(arrays, false, 0);
197
198 mutable.extend(0, 0, 3);
199
200 let result = mutable.freeze();
201 let result = StringArray::from(result);
202
203 let expected = StringArray::from(vec![Some("bc"), None, Some("defh")]);
204 assert_eq!(result, expected);
205}
206
207#[test]
208fn test_string_offsets() {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected