()
| 776 | |
| 777 | #[test] |
| 778 | fn test_round_f64() { |
| 779 | let args: Vec<ArrayRef> = vec![ |
| 780 | Arc::new(Float64Array::from(vec![125.2345; 10])), // input |
| 781 | Arc::new(Int64Array::from(vec![0, 1, 2, 3, 4, 5, -1, -2, -3, -4])), // decimal_places |
| 782 | ]; |
| 783 | |
| 784 | let result = round_arrays(Arc::clone(&args[0]), Some(Arc::clone(&args[1]))) |
| 785 | .expect("failed to initialize function round"); |
| 786 | let floats = |
| 787 | as_float64_array(&result).expect("failed to initialize function round"); |
| 788 | |
| 789 | let expected = Float64Array::from(vec![ |
| 790 | 125.0, 125.2, 125.23, 125.235, 125.2345, 125.2345, 130.0, 100.0, 0.0, 0.0, |
| 791 | ]); |
| 792 | |
| 793 | assert_eq!(floats, &expected); |
| 794 | } |
| 795 | |
| 796 | #[test] |
| 797 | fn test_round_f32_one_input() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…