Example #1
0
def format_char(char: int):
    """Format a char for printing."""
    if asciilib.is_printable(char):
        return _format_printable(char)
    else:
        return _format_control(char)
Example #2
0
def test_is_printable_space():
    assert asciilib.is_printable(ord(' '))
Example #3
0
def test_is_printable():
    assert asciilib.is_printable(ord('a'))
Example #4
0
def test_not_is_printable_escape():
    assert not asciilib.is_printable(ESC)
Example #5
0
def test_not_is_printable_newline():
    assert not asciilib.is_printable(ord('\n'))
Example #6
0
def test_not_is_printable_tab():
    assert not asciilib.is_printable(ord('\t'))