def test21_bytes2csubstr(self): s = b"foo21" m = ryml.as_csubstr(s) self.assertTrue(_same_ptr(s, m)) self.assertTrue(_same_mem(s, m)) self.assertEqual(s, m) # m = ryml.as_csubstr(m) self.assertTrue(_same_ptr(s, m)) self.assertTrue(_same_mem(s, m)) self.assertEqual(s, m)
def test32_bytes2substr(self): s = bytearray("foo31", "utf8") m = ryml.as_csubstr(s) self.assertTrue(_same_ptr(s, m)) self.assertTrue(_same_mem(s, m)) self.assertEqual(s, m) # m = ryml.as_csubstr(m) self.assertTrue(_same_ptr(s, m)) self.assertTrue(_same_mem(s, m)) self.assertEqual(s, m)
def test11_str2csubstr(self): s = "asdasd" m = ryml.as_csubstr(s) self.assertTrue(_same_ptr(s, m)) self.assertTrue(_same_mem(s, m)) self.assertEqual(s, ryml.u(m)) # m = ryml.as_csubstr(m) self.assertTrue(_same_ptr(s, m)) self.assertTrue(_same_mem(s, m)) self.assertEqual(s, ryml.u(m))