| 82 | |
| 83 | #[test] |
| 84 | fn trailing_comma() { |
| 85 | fn f(_py: Python, i: usize, j: usize) -> PyResult<usize> { |
| 86 | Ok(i + j) |
| 87 | } |
| 88 | |
| 89 | let gil = Python::acquire_gil(); |
| 90 | let py = gil.python(); |
| 91 | // Define a function where the parameters are on separate |
| 92 | // lines with trailing commas. |
| 93 | let obj = py_fn!( |
| 94 | py, |
| 95 | f( |
| 96 | first_parameter_with_long_name: usize, |
| 97 | second_parameter_with_long_name: usize, |
| 98 | ) |
| 99 | ); |
| 100 | assert_eq!( |
| 101 | obj.call(py, (1, 1), None) |
| 102 | .unwrap() |
| 103 | .extract::<i32>(py) |
| 104 | .unwrap(), |
| 105 | 2 |
| 106 | ); |
| 107 | } |
| 108 | |
| 109 | #[test] |
| 110 | fn inline_two_args() { |