()
| 337 | |
| 338 | #[test] |
| 339 | fn resize_using_exclusive_borrow() { |
| 340 | Python::attach(|py| { |
| 341 | let array = PyArray::<f64, _>::zeros(py, 3, false); |
| 342 | assert_eq!(array.shape(), [3]); |
| 343 | |
| 344 | let mut array = array.into_readwrite(); |
| 345 | assert_eq!(array.as_slice_mut().unwrap(), &[0.0; 3]); |
| 346 | |
| 347 | let mut array = array.resize(5).unwrap(); |
| 348 | assert_eq!(array.as_slice_mut().unwrap(), &[0.0; 5]); |
| 349 | }); |
| 350 | } |
| 351 | |
| 352 | #[test] |
| 353 | fn can_make_python_array_nonwriteable() { |
nothing calls this directly
no test coverage detected