fonttools/Tests/misc/textTools_test.py
Just van Rossum 5fc65d7168
Misc py23 cleanups (#2243)
* Replaced all from ...py23 import * with explicit name imports, or removed completely when possible.
* Replaced tounicode() with tostr()
* Changed all BytesIO ans StringIO imports to from io import ..., replaced all UnicodeIO with StringIO.
* Replaced all unichr() with chr()
* Misc minor tweaks and fixes
2021-03-29 11:45:58 +02:00

10 lines
264 B
Python

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'