示例#1
0
def test_complex():
    assert group(['.', '1j']) == ['.1j']
    assert group(['.', '1J']) == ['.1J']
    assert group(['1', '.', 'j']) == ['1.j']
    assert group(['1', '.', 'J']) == ['1.J']
    assert group(['1', '.', '1j']) == ['1.1j']
    assert group(['1', '.', '1J']) == ['1.1J']
    assert group(['1J']) == ['1J']
示例#2
0
def test_complex():
    assert group(['.', '1j']) == ['.1j']
    assert group(['.', '1J']) == ['.1J']
    assert group(['1', '.', 'j']) == ['1.j']
    assert group(['1', '.', 'J']) == ['1.J']
    assert group(['1', '.', '1j']) == ['1.1j']
    assert group(['1', '.', '1J']) == ['1.1J']
    assert group(['1J']) == ['1J']
示例#3
0
def test_exponant():
    assert group(['1e', '+', '123']) == ['1e+123']
    assert group(['1e', '-', '123']) == ['1e-123']
    assert group(['1.1e', '+', '123']) == ['1.1e+123']
    assert group(['1.1e', '-', '123']) == ['1.1e-123']
    assert group(['.1e', '+', '123']) == ['.1e+123']
    assert group(['.1e', '-', '123']) == ['.1e-123']
示例#4
0
def test_exponant():
    assert group(['1e', '+', '123']) == ['1e+123']
    assert group(['1e', '-', '123']) == ['1e-123']
    assert group(['1.1e', '+', '123']) == ['1.1e+123']
    assert group(['1.1e', '-', '123']) == ['1.1e-123']
    assert group(['.1e', '+', '123']) == ['.1e+123']
    assert group(['.1e', '-', '123']) == ['.1e-123']
示例#5
0
def test_mult_egual():
    assert group(["*", "="]) == ["*="]
示例#6
0
def test_regression_float():
    assert group(['1', '.']) == ['1.']
    assert group(['.', '1']) == ['.1']
    assert group(['1', '.', '1']) == ['1.1']
    assert group(['7', '.', '629e', '-', '6']) == ['7.629e-6']
示例#7
0
def test_binary_string():
    assert group(["b", "'pouet'"]) == ["b'pouet'"]
    assert group(["B", "'pouet'"]) == ["B'pouet'"]
示例#8
0
def test_decorator():
    assert group(["@", "pouet"]) == ["@", "pouet"]
示例#9
0
def test_div_div_egual():
    assert group(["/", "/", "="]) == ["//="]
示例#10
0
def test_inferior_egual():
    assert group([">", "="]) == [">="]
示例#11
0
def test_empty():
    assert group([]) == []
示例#12
0
def test_add_egual_random():
    assert group(list(" qsd += qsd")) == [" ", "q", "s", "d", " ", "+=", " ", "q", "s", "d"]
示例#13
0
def test_add_egual_double():
    assert group(["+", "=", "+", "="]) == ["+=", "+="]
示例#14
0
def test_add_add():
    assert group(["+", "+"]) == ["+", "+"]
示例#15
0
def test_float_exponant():
    assert group(['1E1']) == ['1E1']
    assert group(['1E', '-', '2']) == ['1E-2']
    assert group(['1E', '+', '2']) == ['1E+2']
    assert group(['1', '.', 'E', '+', '2']) == ['1.E+2']
    assert group(['1', '.', 'E', '-', '2']) == ['1.E-2']
    assert group(['1', '.', 'E', '2']) == ['1.E2']
    assert group(['1', '.', 'E2']) == ['1.E2']
    assert group(['1e1']) == ['1e1']
    assert group(['1e', '-', '2']) == ['1e-2']
    assert group(['1e', '+', '2']) == ['1e+2']
    assert group(['1', '.', 'e', '+', '2']) == ['1.e+2']
    assert group(['1', '.', 'e', '-', '2']) == ['1.e-2']
    assert group(['1', '.', 'e', '2']) == ['1.e2']
    assert group(['1', '.', 'e2']) == ['1.e2']
示例#16
0
def test_add_egual():
    assert group(["+", "="]) == ["+="]
示例#17
0
def test_regression():
    assert group(['0x045e', ':', ' ']) == ['0x045e', ':', ' ']
    assert group(['180', '.', '\n']) == ['180.', '\n']
示例#18
0
def test_amper_egual():
    assert group(["&", "="]) == ["&="]
示例#19
0
def test_power_egual():
    assert group(["^", "="]) == ["^="]
示例#20
0
def test_minus_egual():
    assert group(["-", "="]) == ["-="]
示例#21
0
def test_egual_egual():
    assert group(["=", "="]) == ["=="]
示例#22
0
def test_mult_egual():
    assert group(["*", "="]) == ["*="]
示例#23
0
def test_different_old_style():
    assert group(["<", ">"]) == ["<>"]
示例#24
0
def test_modulo_egual():
    assert group(["%", "="]) == ["%="]
示例#25
0
def test_more_more_egual():
    assert group([">", ">", "="]) == [">>="]
示例#26
0
def test_amper_egual():
    assert group(["&", "="]) == ["&="]
示例#27
0
def test_raw_string():
    assert group(["r", "'pouet'"]) == ["r'pouet'"]
    assert group(["R", "'pouet'"]) == ["R'pouet'"]
示例#28
0
def test_bar_egual():
    assert group(["|", "="]) == ["|="]
示例#29
0
def test_random():
    assert group(list("abcdef")) == list("abcdef")
示例#30
0
def test_power_egual():
    assert group(["^", "="]) == ["^="]
示例#31
0
def test_minus_egual():
    assert group(["-", "="]) == ["-="]
示例#32
0
def test_empty():
    assert group([]) == []
示例#33
0
def test_modulo_egual():
    assert group(["%", "="]) == ["%="]
示例#34
0
def test_less_less():
    assert group(["<", "<"]) == ["<<"]
示例#35
0
def test_bar_egual():
    assert group(["|", "="]) == ["|="]
示例#36
0
def test_more_more():
    assert group([">", ">"]) == [">>"]
示例#37
0
def test_less_less():
    assert group(["<", "<"]) == ["<<"]
示例#38
0
def test_egual_egual():
    assert group(["=", "="]) == ["=="]
示例#39
0
def test_more_more():
    assert group([">", ">"]) == [">>"]
示例#40
0
def test_different():
    assert group(["!", "="]) == ["!="]
示例#41
0
def test_different():
    assert group(["!", "="]) == ["!="]
示例#42
0
def test_inferior_egual():
    assert group([">", "="]) == [">="]
示例#43
0
def test_superior_egual():
    assert group(["<", "="]) == ["<="]
示例#44
0
def test_superior_egual():
    assert group(["<", "="]) == ["<="]
示例#45
0
def test_power_power_egual():
    assert group(["*", "*", "="]) == ["**="]
示例#46
0
def test_different_old_style():
    assert group(["<", ">"]) == ["<>"]
示例#47
0
def test_less_less_egual():
    assert group(["<", "<", "="]) == ["<<="]
示例#48
0
def test_power_power_egual():
    assert group(["*", "*", "="]) == ["**="]
示例#49
0
def test_one():
    assert group(['a']) == ['a']
示例#50
0
def test_div_div_egual():
    assert group(["/", "/", "="]) == ["//="]
示例#51
0
def test_endl():
    assert group(["\r", "\n"]) == ["\r\n"]
示例#52
0
def test_less_less_egual():
    assert group(["<", "<", "="]) == ["<<="]
示例#53
0
def test_unicode_string():
    assert group(["u", "'pouet'"]) == ["u'pouet'"]
    assert group(["U", "'pouet'"]) == ["U'pouet'"]
示例#54
0
def test_random():
    assert group(list("abcdef")) == list("abcdef")
示例#55
0
def test_binary_raw_string():
    assert group(["br", "'pouet'"]) == ["br'pouet'"]
    assert group(["Br", "'pouet'"]) == ["Br'pouet'"]
    assert group(["bR", "'pouet'"]) == ["bR'pouet'"]
    assert group(["BR", "'pouet'"]) == ["BR'pouet'"]
示例#56
0
def test_space_endl_with_backslash():
    assert group([' 	 ', '\\', '\n', '   ']) == [' 	 \\\n   ']
    assert group([' 	 ', '\\', '\n', 'pouet']) == [' 	 \\\n', 'pouet']
示例#57
0
def grouper_test(input, split_output, group_output):
    assert split(input) == split_output
    assert group(split_output) == group_output
示例#58
0
def test_backslash_window_endl():
    assert group(['\\', '\r', '\n']) == ['\\\r\n']
示例#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_add_egual_random():
    assert group(list(" qsd += qsd")) == [" ", "q", "s", "d", " ", "+=", " ", "q", "s", "d"]