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

Function test_decimal128

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

Source from the content-addressed store, hash-verified

2398
2399 #[test]
2400 fn test_decimal128() {
2401 let values: Vec<_> = vec![0, 1, -1, i128::MIN, i128::MAX];
2402 let array: PrimitiveArray<Decimal128Type> =
2403 PrimitiveArray::from_iter(values.iter().copied());
2404 assert_eq!(array.values(), &values);
2405
2406 let array: PrimitiveArray<Decimal128Type> =
2407 PrimitiveArray::from_iter_values(values.iter().copied());
2408 assert_eq!(array.values(), &values);
2409
2410 let array = PrimitiveArray::<Decimal128Type>::from(values.clone());
2411 assert_eq!(array.values(), &values);
2412
2413 let array = PrimitiveArray::<Decimal128Type>::from(array.to_data());
2414 assert_eq!(array.values(), &values);
2415 }
2416
2417 #[test]
2418 fn test_decimal256() {

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