MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_multiply_str

Function test_multiply_str

crates/vm/src/vm/interpreter.rs:576–584  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

574
575 #[test]
576 fn test_multiply_str() {
577 Interpreter::without_stdlib(Default::default()).enter(|vm| {
578 let a = vm.new_pyobj(crate::common::ascii!("Hello "));
579 let b = vm.new_pyobj(4_i32);
580 let res = vm._mul(&a, &b).unwrap();
581 let value = res.downcast_ref::<PyStr>().unwrap();
582 assert_eq!(value.as_wtf8(), "Hello Hello Hello Hello ")
583 })
584 }
585}

Callers

nothing calls this directly

Calls 4

new_pyobjMethod · 0.80
enterMethod · 0.45
unwrapMethod · 0.45
_mulMethod · 0.45

Tested by

no test coverage detected