mirror of
https://github.com/ihabunek/toot.git
synced 2024-09-22 04:25:55 -04:00
15 lines
435 B
Python
15 lines
435 B
Python
|
from toot import utils
|
||
|
|
||
|
|
||
|
def test_pad():
|
||
|
text = 'Frank Zappa 🎸'
|
||
|
padded = utils.pad(text, 14)
|
||
|
assert padded == 'Frank Zappa 🎸'
|
||
|
# guitar symbol will occupy two cells, so padded text should be 1
|
||
|
# character shorter
|
||
|
assert len(padded) == 13
|
||
|
# when truncated, … occupies one cell, so we get full length
|
||
|
padded = utils.pad(text, 13)
|
||
|
assert padded == 'Frank Zappa …'
|
||
|
assert len(padded) == 13
|