コード例 #1
0
def test_insert_line_break_basic_2():
    output = """\
looooooooooooooooooooooong = 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2;
"""
    assert output == line_breaker("""\
looooooooooooooooooooooong = 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2;
""")
コード例 #2
0
def test_insert_line_break_basic_8():
    output = """\
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhh
"""
    assert output == line_breaker("""\
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhh
""")
コード例 #3
0
def test_insert_line_break_basic_6():
    output = """\
int\tlooooooooooooooooooooooong = 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2
\t\t+ 2 + 2;
"""
    assert output == line_breaker("""\
int\tlooooooooooooooooooooooong = 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2;
""")
コード例 #4
0
def test_insert_line_break_basic_3():
    output = """\
\t\t\t\treturn (fooooooooooooooooooooooooo(a, b, cccccccccccc,
\t\t\t\t\t\t\tddddddddddddd, eeeeeeeeeeeeeeee, fffffffffffffff,
\t\t\t\t\t\t\tgggggggggggg, hhhhhhhhhhhhhhhhhh));
"""
    assert output == line_breaker("""\
\t\t\t\treturn (fooooooooooooooooooooooooo(a, b, cccccccccccc, ddddddddddddd, eeeeeeeeeeeeeeee, fffffffffffffff, gggggggggggg, hhhhhhhhhhhhhhhhhh));
""")
コード例 #5
0
def test_insert_line_break_long_function_declaration():
    input = """
static void\tst_merge_fields_in_curr(char *strs[3], t_tok_lst **curr, t_tok_lst *fields)
"""
    output = """
static void\tst_merge_fields_in_curr(char *strs[3], t_tok_lst **curr,
\t\tt_tok_lst *fields)
"""
    assert line_breaker(input) == output
コード例 #6
0
def test_insert_line_break_control_statement_2():
    input = """\
\tif (true + false)
"""
    output = """\
\tif (true
\t\t+ false)
"""
    assert line_breaker(input, 5) == output
コード例 #7
0
def test_insert_line_break_basic_22():
    output = ",\n\taaaa* b"
    assert output == line_breaker(", aaaa* b", 7)
コード例 #8
0
def test_insert_line_break_basic_23():
    output = "foooooo(bar\n\t\t* baz)"
    assert output == line_breaker("foooooo(bar * baz)", 7)
コード例 #9
0
def test_insert_line_break_basic_20():
    output = "*aaaa\n\t* b"
    assert output == line_breaker("*aaaa * b", 7)
コード例 #10
0
def test_insert_line_break_basic_19():
    output = "aaaa*\n\t* b"
    assert output == line_breaker("aaaa* * b", 7)
コード例 #11
0
def test_insert_line_break_basic_18():
    output = "aaaa\n\t* b*"
    assert output == line_breaker("aaaa * b*", 7)
コード例 #12
0
def test_insert_line_break_basic_15():
    output = "aaaa\n\t+ *b"
    assert output == line_breaker("aaaa + *b", 7)
コード例 #13
0
def test_insert_line_break_basic_14():
    output = "aaaa\n\t% b"
    assert output == line_breaker("aaaa % b", 7)