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