Exemplo n.º 1
0
def test_pack_into():
    size = ASCII_SIZE + UTF8_SIZE
    buf = bytearray(size)
    offset = 0

    offset = CString.pack_into(buf, offset, "ABC", "ascii")
    offset = CString.pack_into(buf, offset, "日本語")

    assert buf == (ASCII + UTF8)
    assert offset == size
Exemplo n.º 2
0
def test_pack_into():
    size = ASCII_SIZE + UTF8_SIZE
    buf = bytearray(size)
    offset = 0

    offset = CString.pack_into(buf, offset, "ABC", "ascii")
    offset = CString.pack_into(buf, offset, "日本語")

    assert buf == (ASCII + UTF8)
    assert offset == size