()
| 309 | |
| 310 | #[test] |
| 311 | fn test_cot_scalar_zero() { |
| 312 | let arg_fields = vec![Field::new("a", DataType::Float64, false).into()]; |
| 313 | let args = ScalarFunctionArgs { |
| 314 | args: vec![ColumnarValue::Scalar(ScalarValue::Float64(Some(0.0)))], |
| 315 | arg_fields, |
| 316 | number_rows: 1, |
| 317 | return_field: Field::new("f", DataType::Float64, false).into(), |
| 318 | config_options: Arc::new(ConfigOptions::default()), |
| 319 | }; |
| 320 | let result = CotFunc::new() |
| 321 | .invoke_with_args(args) |
| 322 | .expect("cot zero should succeed"); |
| 323 | |
| 324 | match result { |
| 325 | ColumnarValue::Scalar(ScalarValue::Float64(Some(v))) => { |
| 326 | // cot(0) = 1/tan(0) = infinity |
| 327 | assert!(v.is_infinite()); |
| 328 | } |
| 329 | _ => panic!("Expected Float64 scalar"), |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | #[test] |
| 334 | fn test_cot_scalar_pi() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…