()
| 472 | |
| 473 | #[test] |
| 474 | fn execute_map_name_based() { |
| 475 | let km = PyKernelModule::new(); |
| 476 | let x = km.arg("x"); |
| 477 | let y = km.arg("y"); |
| 478 | // x + y |
| 479 | let expr = PyExpr::binop_with_temp_args( |
| 480 | BinaryOp::Add, |
| 481 | &x.inner, |
| 482 | &y.inner, |
| 483 | &x.temp_args, |
| 484 | &y.temp_args, |
| 485 | ); |
| 486 | let spec = km.elementwise(expr).unwrap(); |
| 487 | |
| 488 | // Create MapSpec manually with named args |
| 489 | let mut args = HashMap::new(); |
| 490 | args.insert( |
| 491 | "x".to_string(), |
| 492 | ArgValue::Buffer(Buffer::from_f64_vec(vec![1.0, 2.0, 3.0])), |
| 493 | ); |
| 494 | args.insert( |
| 495 | "y".to_string(), |
| 496 | ArgValue::Buffer(Buffer::from_f64_vec(vec![10.0, 20.0, 30.0])), |
| 497 | ); |
| 498 | let map_spec = PyMapSpec { spec, args }; |
| 499 | |
| 500 | let result = execute_map(&map_spec).unwrap(); |
| 501 | let data = result.as_f64_slice(); |
| 502 | assert_eq!(data, &[11.0, 22.0, 33.0]); |
| 503 | } |
| 504 | |
| 505 | #[test] |
| 506 | fn execute_map_missing_arg() { |
nothing calls this directly
no test coverage detected