コード例 #1
0
def test_search_regex_precompiled_pattern(chikin):
    """Find all occurenses of a regex in the document text"""
    pattern = re.compile(r"unless[a-z ]*")
    matches = list(chikin.search_regex(pattern))
    assert len(matches) == 1
    assert matches[0] == "unless ordered to squat"
    assert matches[0].position == 341
コード例 #2
0
ファイル: test_api.py プロジェクト: alvinwan/TexSoup
def test_search_regex_precompiled_pattern(chikin):
    """Find all occurenses of a regex in the document text"""
    pattern = re.compile(r"unless[a-z ]*")
    matches = list(chikin.search_regex(pattern))
    assert len(matches) == 1
    assert matches[0] == "unless ordered to squat"
    assert matches[0].position == 341
コード例 #3
0
def test_search_regex(chikin):
    """Find all occurenses of a regex in the document text"""
    matches = list(chikin.search_regex(r"unless[a-z ]*"))
    assert len(matches) == 1
    assert matches[0] == "unless ordered to squat"
    assert matches[0].position == 341
コード例 #4
0
ファイル: test_api.py プロジェクト: alvinwan/TexSoup
def test_search_regex(chikin):
    """Find all occurenses of a regex in the document text"""
    matches = list(chikin.search_regex(r"unless[a-z ]*"))
    assert len(matches) == 1
    assert matches[0] == "unless ordered to squat"
    assert matches[0].position == 341