示例#1
0
def test_latin_and_punctuation():
    assert convert.utf_len(b"Hello!") == 6
示例#2
0
def test_mixed():
    assert convert.utf_len("Hello! Привіт! こんにちは".encode('utf-8')) == 20
示例#3
0
def test_empty_string():
    assert convert.utf_len(b"") == 0
示例#4
0
def test_japanese():
    assert convert.utf_len("こんにちは".encode('utf-8')) == 5
示例#5
0
def test_cyrillic():
    assert convert.utf_len("Привіт!".encode('utf-8')) == 7
示例#6
0
def test_empty_string():
    """

    :return:
    """
    assert convert.utf_len(b"") == 0
示例#7
0
def test_japanese():
    """

    :return:
    """
    assert convert.utf_len("こんにちは".encode('utf-8')) == 5
示例#8
0
def test_latin_and_punctuation():
    """

    :return:
    """
    assert convert.utf_len(b"Hello!") == 6