()
| 310 | |
| 311 | #[test] |
| 312 | fn readonly_as_array_slice_get() { |
| 313 | Python::attach(|py| { |
| 314 | let array = PyArray::<f64, _>::zeros(py, (1, 2, 3), false); |
| 315 | let array = array.readonly(); |
| 316 | |
| 317 | assert_eq!(array.as_array().shape(), [1, 2, 3]); |
| 318 | assert_eq!(array.as_slice().unwrap().len(), 2 * 3); |
| 319 | assert_eq!(*array.get([0, 1, 2]).unwrap(), 0.0); |
| 320 | }); |
| 321 | } |
| 322 | |
| 323 | #[test] |
| 324 | fn readwrite_as_array_slice() { |