()
| 1060 | |
| 1061 | #[test] |
| 1062 | fn test_decimal_full_validation() { |
| 1063 | let array = Decimal128Array::from(vec![123456_i128]) |
| 1064 | .with_precision_and_scale(5, 2) |
| 1065 | .unwrap(); |
| 1066 | let error = array.validate_decimal_precision(5).unwrap_err(); |
| 1067 | assert_eq!( |
| 1068 | "Invalid argument error: 1234.56 is too large to store in a Decimal128 of precision 5. Max is 999.99", |
| 1069 | error.to_string() |
| 1070 | ); |
| 1071 | |
| 1072 | let array = Decimal128Array::from(vec![123456_i128]); |
| 1073 | let error = array.validate_decimal_precision(5).unwrap_err(); |
| 1074 | assert_eq!( |
| 1075 | "Invalid argument error: Decimal precision 5 is less than scale 10", |
| 1076 | error.to_string() |
| 1077 | ); |
| 1078 | } |
| 1079 | |
| 1080 | #[test] |
| 1081 | fn test_decimal_validation() { |
nothing calls this directly
no test coverage detected