MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / test_seq_concat_string

Function test_seq_concat_string

src/objects/sequence.rs:529–548  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

527
528 #[test]
529 fn test_seq_concat_string() {
530 let gil = Python::acquire_gil();
531 let py = gil.python();
532 let v = "string";
533 let seq = v
534 .to_py_object(py)
535 .into_object()
536 .cast_into::<PySequence>(py)
537 .unwrap();
538 let concat_seq = seq
539 .concat(py, &seq)
540 .unwrap()
541 .cast_into::<PySequence>(py)
542 .unwrap();
543 assert_eq!(12, concat_seq.len(py).unwrap());
544 /*let concat_v = "stringstring".to_owned();
545 for (el, cc) in seq.iter(py).unwrap().zip(concat_v.chars()) {
546 assert_eq!(cc, el.unwrap().extract::<char>(py).unwrap()); //TODO: extract::<char>() is not implemented
547 }*/
548 }
549
550 #[test]
551 fn test_seq_repeat() {

Callers

nothing calls this directly

Calls 4

pythonMethod · 0.80
concatMethod · 0.80
into_objectMethod · 0.45
to_py_objectMethod · 0.45

Tested by

no test coverage detected