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

Function unary_arithmetic

tests/test_class.rs:816–825  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

814
815#[test]
816fn unary_arithmetic() {
817 let gil = Python::acquire_gil();
818 let py = gil.python();
819
820 let c = UnaryArithmetic::create_instance(py).unwrap();
821 py_run!(py, c, "assert -c == 'neg'");
822 py_run!(py, c, "assert +c == 'pos'");
823 py_run!(py, c, "assert abs(c) == 'abs'");
824 py_run!(py, c, "assert ~c == 'invert'");
825}
826
827py_class!(class BinaryArithmetic |py| {
828 def __repr__(&self) -> PyResult<&'static str> {

Callers

nothing calls this directly

Calls 1

pythonMethod · 0.80

Tested by

no test coverage detected