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

Function test_run_array_fmt_debug

arrow-array/src/array/run_array.rs:943–968  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

941
942 #[test]
943 fn test_run_array_fmt_debug() {
944 let mut builder = PrimitiveRunBuilder::<Int16Type, UInt32Type>::with_capacity(3);
945 builder.append_value(12345678);
946 builder.append_null();
947 builder.append_value(22345678);
948 let array = builder.finish();
949 assert_eq!(
950 "RunArray {run_ends: [1, 2, 3], values: PrimitiveArray<UInt32>\n[\n 12345678,\n null,\n 22345678,\n]}\n",
951 format!("{array:?}")
952 );
953
954 let mut builder = PrimitiveRunBuilder::<Int16Type, UInt32Type>::with_capacity(20);
955 for _ in 0..20 {
956 builder.append_value(1);
957 }
958 let array = builder.finish();
959
960 assert_eq!(array.len(), 20);
961 assert_eq!(array.null_count(), 0);
962 assert_eq!(array.logical_null_count(), 0);
963
964 assert_eq!(
965 "RunArray {run_ends: [20], values: PrimitiveArray<UInt32>\n[\n 1,\n]}\n",
966 format!("{array:?}")
967 );
968 }
969
970 #[test]
971 fn test_run_array_from_iter() {

Callers

nothing calls this directly

Calls 3

append_valueMethod · 0.45
append_nullMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected