()
| 757 | |
| 758 | #[test] |
| 759 | fn test_round_f32() { |
| 760 | let args: Vec<ArrayRef> = vec![ |
| 761 | Arc::new(Float32Array::from(vec![125.2345; 10])), // input |
| 762 | Arc::new(Int64Array::from(vec![0, 1, 2, 3, 4, 5, -1, -2, -3, -4])), // decimal_places |
| 763 | ]; |
| 764 | |
| 765 | let result = round_arrays(Arc::clone(&args[0]), Some(Arc::clone(&args[1]))) |
| 766 | .expect("failed to initialize function round"); |
| 767 | let floats = |
| 768 | as_float32_array(&result).expect("failed to initialize function round"); |
| 769 | |
| 770 | let expected = Float32Array::from(vec![ |
| 771 | 125.0, 125.2, 125.23, 125.235, 125.2345, 125.2345, 130.0, 100.0, 0.0, 0.0, |
| 772 | ]); |
| 773 | |
| 774 | assert_eq!(floats, &expected); |
| 775 | } |
| 776 | |
| 777 | #[test] |
| 778 | fn test_round_f64() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…