()
| 220 | |
| 221 | #[test] |
| 222 | fn test_insert() { |
| 223 | let gil = Python::acquire_gil(); |
| 224 | let py = gil.python(); |
| 225 | let v = vec![2, 3, 5, 7]; |
| 226 | let list = v.to_py_object(py); |
| 227 | let val = 42i32.to_py_object(py).into_object(); |
| 228 | assert_eq!(4, list.len(py)); |
| 229 | assert_eq!(2, list.get_item(py, 0).extract::<i32>(py).unwrap()); |
| 230 | list.insert(py, 0, val); |
| 231 | assert_eq!(5, list.len(py)); |
| 232 | assert_eq!(42, list.get_item(py, 0).extract::<i32>(py).unwrap()); |
| 233 | assert_eq!(2, list.get_item(py, 1).extract::<i32>(py).unwrap()); |
| 234 | } |
| 235 | |
| 236 | #[test] |
| 237 | fn test_append() { |
nothing calls this directly
no test coverage detected