()
| 304 | |
| 305 | #[test] |
| 306 | fn test_named_reordering() { |
| 307 | let param_names = vec!["a".to_string(), "b".to_string(), "c".to_string()]; |
| 308 | |
| 309 | // Call with: func(c => 3.0, a => 1, b => "hello") |
| 310 | let args = vec![lit(3.0), lit(1), lit("hello")]; |
| 311 | let arg_names = vec![ |
| 312 | Some(ArgumentName { |
| 313 | value: "c".to_string(), |
| 314 | is_quoted: false, |
| 315 | }), |
| 316 | Some(ArgumentName { |
| 317 | value: "a".to_string(), |
| 318 | is_quoted: false, |
| 319 | }), |
| 320 | Some(ArgumentName { |
| 321 | value: "b".to_string(), |
| 322 | is_quoted: false, |
| 323 | }), |
| 324 | ]; |
| 325 | |
| 326 | let result = resolve_function_arguments(¶m_names, args, arg_names).unwrap(); |
| 327 | |
| 328 | // Should be reordered to [a, b, c] = [1, "hello", 3.0] |
| 329 | assert_eq!(result.len(), 3); |
| 330 | assert_eq!(result[0], lit(1)); |
| 331 | assert_eq!(result[1], lit("hello")); |
| 332 | assert_eq!(result[2], lit(3.0)); |
| 333 | } |
| 334 | |
| 335 | #[test] |
| 336 | fn test_mixed_positional_and_named() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…