(self)
| 1596 | # self.assertGreaterEqual since, in RustPython, the underlying storage |
| 1597 | # is a Vec which doesn't require trailing null byte. |
| 1598 | def test_alloc(self): |
| 1599 | b = bytearray() |
| 1600 | alloc = b.__alloc__() |
| 1601 | self.assertGreaterEqual(alloc, 0) |
| 1602 | seq = [alloc] |
| 1603 | for i in range(100): |
| 1604 | b += b"x" |
| 1605 | alloc = b.__alloc__() |
| 1606 | self.assertGreaterEqual(alloc, len(b)) # NOTE: RUSTPYTHON patched |
| 1607 | if alloc not in seq: |
| 1608 | seq.append(alloc) |
| 1609 | |
| 1610 | # NOTE: RUSTPYTHON: |
| 1611 | # |
nothing calls this directly
no test coverage detected