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

Function test_decimal32

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

Source from the content-addressed store, hash-verified

2362
2363 #[test]
2364 fn test_decimal32() {
2365 let values: Vec<_> = vec![0, 1, -1, i32::MIN, i32::MAX];
2366 let array: PrimitiveArray<Decimal32Type> =
2367 PrimitiveArray::from_iter(values.iter().copied());
2368 assert_eq!(array.values(), &values);
2369
2370 let array: PrimitiveArray<Decimal32Type> =
2371 PrimitiveArray::from_iter_values(values.iter().copied());
2372 assert_eq!(array.values(), &values);
2373
2374 let array = PrimitiveArray::<Decimal32Type>::from(values.clone());
2375 assert_eq!(array.values(), &values);
2376
2377 let array = PrimitiveArray::<Decimal32Type>::from(array.to_data());
2378 assert_eq!(array.values(), &values);
2379 }
2380
2381 #[test]
2382 fn test_decimal64() {

Callers

nothing calls this directly

Calls 4

from_iterFunction · 0.50
iterMethod · 0.45
cloneMethod · 0.45
to_dataMethod · 0.45

Tested by

no test coverage detected