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