huangcm
2024-12-18 9d29be7f7249789d6ffd0440067187a9f040c2cd
1
2
3
4
5
6
7
8
9
10
11
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc.textTools import pad
 
 
def test_pad():
    assert len(pad(b'abcd', 4)) == 4
    assert len(pad(b'abcde', 2)) == 6
    assert len(pad(b'abcde', 4)) == 8
    assert pad(b'abcdef', 4) == b'abcdef\x00\x00'
    assert pad(b'abcdef', 1) == b'abcdef'