コード例 #1
0
def test_tokenize_alphanumeric():
    assert ["uzer"] == codespell.tokenize("uzer42")
コード例 #2
0
def test_tokenize_camel_case():
    assert ["camel", "Case"] == codespell.tokenize("camelCase")
    assert ["Title", "Case"] == codespell.tokenize("TitleCase")
    assert ["Title", "Case", "mixed"] == codespell.tokenize("TitleCase mixed")
コード例 #3
0
def test_tokenize_namespace():
    assert ["std", "mem"] == codespell.tokenize("std::mem")
    assert ["std", "mem"] == codespell.tokenize("std:mem")
コード例 #4
0
def test_tokenize_pointers():
    assert ["pointer"] == codespell.tokenize("*pointer")
    assert ["pointer"] == codespell.tokenize("&pointer")
    assert ["pointer"] == codespell.tokenize("&&*pointer")
コード例 #5
0
def test_tokenize_quotes():
    assert ["Hello", "World"] == codespell.tokenize("Hello\"World\"")
    assert ["Hello", "World"] == codespell.tokenize("Hello\'World\'")
    assert ["Hello", "World"] == codespell.tokenize("Hello \'World\'")
コード例 #6
0
def test_tokenize_brackets():
    assert ["Hello", "World"] == codespell.tokenize("Hello(World)")
    assert ["Hello", "World"] == codespell.tokenize("Hello[World]")
    assert ["Hello", "World"] == codespell.tokenize("Hello{World}")
    assert ["Hello", "World"] == codespell.tokenize("Hello<World>")
コード例 #7
0
def test_tokenize_underscore():
    assert ["Hello", "World"] == codespell.tokenize("Hello_World")
コード例 #8
0
def test_tokenize_plain():
    assert ["Hello", "World"] == codespell.tokenize("Hello World")