()
| 364 | |
| 365 | #[test] |
| 366 | fn handle_negative_strides() { |
| 367 | Python::attach(|py| { |
| 368 | let arr = array![[2, 3], [4, 5u32]]; |
| 369 | let pyarr = arr.to_pyarray(py); |
| 370 | |
| 371 | let neg_str_pyarr = py |
| 372 | .eval( |
| 373 | c_str!("a[::-1]"), |
| 374 | Some(&[("a", pyarr)].into_py_dict(py).unwrap()), |
| 375 | None, |
| 376 | ) |
| 377 | .unwrap() |
| 378 | .cast_into::<PyArray2<u32>>() |
| 379 | .unwrap(); |
| 380 | |
| 381 | assert_eq!( |
| 382 | neg_str_pyarr.readonly().as_array(), |
| 383 | arr.slice(s![..;-1, ..]) |
| 384 | ); |
| 385 | }); |
| 386 | } |
| 387 | |
| 388 | #[test] |
| 389 | fn dtype_via_python_attribute() { |
nothing calls this directly
no test coverage detected