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

Function test_into_builder_cloned_array

arrow-array/src/array/primitive_array.rs:2784–2799  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2782
2783 #[test]
2784 fn test_into_builder_cloned_array() {
2785 let array: Int32Array = vec![1, 2, 3].into_iter().map(Some).collect();
2786
2787 let boxed: ArrayRef = Arc::new(array);
2788
2789 let col: Int32Array = PrimitiveArray::<Int32Type>::from(boxed.to_data());
2790 let err = col.into_builder();
2791
2792 match err {
2793 Ok(_) => panic!("Should not get builder from cloned array"),
2794 Err(returned) => {
2795 let expected: Int32Array = vec![1, 2, 3].into_iter().map(Some).collect();
2796 assert_eq!(expected, returned)
2797 }
2798 }
2799 }
2800
2801 #[test]
2802 fn test_into_builder_on_sliced_array() {

Callers

nothing calls this directly

Calls 4

collectMethod · 0.80
into_iterMethod · 0.45
to_dataMethod · 0.45
into_builderMethod · 0.45

Tested by

no test coverage detected