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

Function test_decimal256

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

Source from the content-addressed store, hash-verified

2416
2417 #[test]
2418 fn test_decimal256() {
2419 let values: Vec<_> = vec![i256::ZERO, i256::ONE, i256::MINUS_ONE, i256::MIN, i256::MAX];
2420
2421 let array: PrimitiveArray<Decimal256Type> =
2422 PrimitiveArray::from_iter(values.iter().copied());
2423 assert_eq!(array.values(), &values);
2424
2425 let array: PrimitiveArray<Decimal256Type> =
2426 PrimitiveArray::from_iter_values(values.iter().copied());
2427 assert_eq!(array.values(), &values);
2428
2429 let array = PrimitiveArray::<Decimal256Type>::from(values.clone());
2430 assert_eq!(array.values(), &values);
2431
2432 let array = PrimitiveArray::<Decimal256Type>::from(array.to_data());
2433 assert_eq!(array.values(), &values);
2434 }
2435
2436 #[test]
2437 fn test_decimal_array() {

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