File: textTools_test.py

package info (click to toggle)
fonttools 4.61.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,584 kB
  • sloc: python: 145,091; xml: 103; makefile: 24
file content (9 lines) | stat: -rw-r--r-- 264 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
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"