示例#1
0
def test_missing_quote_yields_error():
    with pytest.raises(UntreatedError):
        split("'")

    with pytest.raises(UntreatedError):
        split("'''")

    with pytest.raises(UntreatedError):
        split('"')

    with pytest.raises(UntreatedError):
        split('"""')
示例#2
0
def test_missing_quote_yields_error():
    with pytest.raises(UntreatedError):
        split("'")

    with pytest.raises(UntreatedError):
        split("'''")

    with pytest.raises(UntreatedError):
        split('"')

    with pytest.raises(UntreatedError):
        split('"""')
示例#3
0
def test_multi_string():
    assert split("'''pouet pouet'''") == ["'''pouet pouet'''"]
示例#4
0
def test_call():
    assert split("function()") == ["function", "(", ")"]
示例#5
0
def test_empty():
    assert split("") == []
示例#6
0
def test_comma_with_words():
    assert split("a, b") == ["a", ",", " ", "b"]
示例#7
0
def test_several_spaces():
    assert split("     ") == ["     "]
示例#8
0
 def test_remove_crap():
     assert split("\x0c\xef\xbb\xbf") == []
示例#9
0
def test_multi_string_with_same_quotes_in():
    assert split('"""pouet " "" pouet"""') == ['"""pouet " "" pouet"""']
示例#10
0
def test_hexa():
    assert split("0x7F") == ["0x7F"]
示例#11
0
def test_other_escape_string():
    assert split("'\\\\'") == ["'\\\\'"]
示例#12
0
def test_underscore_variable():
    assert split("some_variable") == ["some_variable"]
示例#13
0
def test_escape_in_string():
    assert split("'\\\\'") == ["'\\\\'"]
示例#14
0
def test_escape():
    assert split("\\\\") == ["\\", "\\"]
示例#15
0
def test_multi_string_other_quotes():
    assert split('"""pouet pouet"""') == ['"""pouet pouet"""']
示例#16
0
def test_escape():
    assert split("\\\\") == ["\\", "\\"]
示例#17
0
def test_other_escape_string():
    assert split("'\\\\'") == ["'\\\\'"]
示例#18
0
def test_multi_string_with_same_quotes_in():
    assert split('"""pouet " "" pouet"""') == ['"""pouet " "" pouet"""']
示例#19
0
def test_backslash_in_comment():
    assert split("# pouet \\t pouet\npouet") == ["# pouet \\t pouet", "\n", "pouet"]
示例#20
0
def test_comment_backslash():
    assert split('# pouet \\\npouet') == ["# pouet \\", "\n", "pouet"]
示例#21
0
def test_decorator():
    assert split("@pouet") == ["@", "pouet"]
示例#22
0
def test_backslash_in_comment():
    assert split("# pouet \\t pouet\npouet") == [
        "# pouet \\t pouet", "\n", "pouet"
    ]
示例#23
0
def test_several_numbers():
    assert split("12 34") == ["12", " ", "34"]
示例#24
0
def test_regression():
    assert split("(r'[\"\\'](.|\n|\r)*[\"\\']', 'STRING'),") == [
        "(", "r", "'[\"\\'](.|\n|\r)*[\"\\']'", ",", " ", "'STRING'", ")", ","
    ]
示例#25
0
def test_dot_with_word():
    assert split("a.b") == ["a", ".", "b"]
示例#26
0
 def test_remove_crap():
     assert split("\x0c\xef\xbb\xbf") == []
示例#27
0
def test_colon_word():
    assert split("pouet;") == ["pouet", ";"]
示例#28
0
def test_different_case():
    assert split("AbCd cDeF") == ["AbCd", " ", "cDeF"]
示例#29
0
def grouper_test(input, split_output, group_output):
    assert split(input) == split_output
    assert group(split_output) == group_output
示例#30
0
def test_decorator():
    assert split("@pouet") == ["@", "pouet"]
示例#31
0
def test_underscore_variable():
    assert split("some_variable") == ["some_variable"]
示例#32
0
def test_tab_n_space():
    assert split("	 ") == ["	 "]
示例#33
0
def test_escape_in_string():
    assert split("'\\\\'") == ["'\\\\'"]
示例#34
0
def test_several_spaces():
    assert split("     ") == ["     "]
示例#35
0
def test_hexa():
    assert split("0x7F") == ["0x7F"]
示例#36
0
def test_numbers():
    assert split("1234") == ["1234"]
示例#37
0
def test_comment_backslash():
    assert split('# pouet \\\npouet') == ["# pouet \\", "\n", "pouet"]
示例#38
0
def test_several_numbers():
    assert split("12 34") == ["12", " ", "34"]
示例#39
0
def test_regression():
    assert split("(r'[\"\\'](.|\n|\r)*[\"\\']', 'STRING'),") == ["(", "r", "'[\"\\'](.|\n|\r)*[\"\\']'", ",", " ", "'STRING'", ")", ","]
示例#40
0
def test_comma():
    assert split(",") == [","]
示例#41
0
def test_different_case():
    assert split("AbCd cDeF") == ["AbCd", " ", "cDeF"]
示例#42
0
def test_comma_with_words():
    assert split("a, b") == ["a", ",", " ", "b"]
示例#43
0
def test_tab_n_space():
    assert split("	 ") == ["	 "]
示例#44
0
def test_dot():
    assert split(".") == ["."]
示例#45
0
def test_numbers():
    assert split("1234") == ["1234"]
示例#46
0
def test_dot_with_word():
    assert split("a.b") == ["a", ".", "b"]
示例#47
0
def test_comma():
    assert split(",") == [","]
示例#48
0
def test_dot_with_words():
    assert split("a.b.c") == ["a", ".", "b", ".", "c"]
示例#49
0
def test_dot():
    assert split(".") == ["."]
示例#50
0
def test_colon():
    assert split(";") == [";"]
示例#51
0
def test_dot_with_words():
    assert split("a.b.c") == ["a", ".", "b", ".", "c"]
示例#52
0
def test_colon_word():
    assert split("pouet;") == ["pouet", ";"]
示例#53
0
def test_colon():
    assert split(";") == [";"]
示例#54
0
def test_empty():
    assert split("") == []
示例#55
0
def test_assign():
    assert split("a = b") == ["a", " ", "=", " ", "b"]
示例#56
0
def test_assign():
    assert split("a = b") == ["a", " ", "=", " ", "b"]
示例#57
0
def test_call_with_arg():
    assert split("function(a)") == ["function", "(", "a", ")"]
示例#58
0
 def test_assign_unicode():
     assert split("α = β") == ["α", " ", "=", " ", "β"]
示例#59
0
def grouper_test(input, split_output, group_output):
    assert split(input) == split_output
    assert group(split_output) == group_output
示例#60
0
def test_multi_string_other_quotes():
    assert split('"""pouet pouet"""') == ['"""pouet pouet"""']