def test_is_ctrl_char():
    "Tests whether a character is a control character"

    for i in range(0, 127):
        result = textfilter.is_ctrl_char(chr(i))
        assert (i < 32 and i not in (9, 10, 13)) == result

    # Test ordinal override
    assert not textfilter.is_ctrl_char(chr(3), 50)
dataset/ETHPy150Open mozilla/app-validator/tests/test_textfilter.py/test_is_ctrl_char/original