if li_std_string_extra.test_const_reference(a) != x: raise RuntimeError, "bad string mapping" b = li_std_string_extra.string(" world") s = a + b if a + b != "hello world": print a + b raise RuntimeError, "bad string mapping" if a + " world" != "hello world": raise RuntimeError, "bad string mapping" # This is expected to fail with -builtin option # Reverse operators not supported in builtin types if not li_std_string_extra.is_python_builtin(): if "hello" + b != "hello world": raise RuntimeError, "bad string mapping" c = "hello" + b if c.find_last_of("l") != 9: raise RuntimeError, "bad string mapping" s = "hello world" b = li_std_string_extra.B("hi") b.name = li_std_string_extra.string("hello") if b.name != "hello": raise RuntimeError, "bad string mapping"