()
| 433 | |
| 434 | #[test] |
| 435 | fn test_seq_index() { |
| 436 | let gil = Python::acquire_gil(); |
| 437 | let py = gil.python(); |
| 438 | let v: Vec<i32> = vec![1, 1, 2, 3, 5, 8]; |
| 439 | let seq = v |
| 440 | .to_py_object(py) |
| 441 | .into_object() |
| 442 | .cast_into::<PySequence>(py) |
| 443 | .unwrap(); |
| 444 | assert_eq!(0, seq.index(py, 1i32).unwrap()); |
| 445 | assert_eq!(2, seq.index(py, 2i32).unwrap()); |
| 446 | assert_eq!(3, seq.index(py, 3i32).unwrap()); |
| 447 | assert_eq!(4, seq.index(py, 5i32).unwrap()); |
| 448 | assert_eq!(5, seq.index(py, 8i32).unwrap()); |
| 449 | assert!(seq.index(py, 42i32).is_err()); |
| 450 | } |
| 451 | |
| 452 | #[test] |
| 453 | fn test_seq_count() { |
nothing calls this directly
no test coverage detected