v0.6.0 BigUpdate
This commit is contained in:
@@ -62,6 +62,39 @@ def test_parse_colspan_markers():
|
||||
assert data[2].merge_h == "none"
|
||||
|
||||
|
||||
SAMPLE_LT_HEADER = """\
|
||||
| Ситуация | < | < | < |
|
||||
|---|---|---|---|
|
||||
| Шаг | a | b | c |
|
||||
"""
|
||||
|
||||
SAMPLE_LT_BODY = """\
|
||||
| A | B | C |
|
||||
|---|---|---|
|
||||
| wide | < | Z |
|
||||
"""
|
||||
|
||||
|
||||
def test_parse_lt_colspan_in_header():
|
||||
doc = markdown.parse(SAMPLE_LT_HEADER)
|
||||
t = next(c for c in doc.children if isinstance(c, MdTable))
|
||||
header = t.children[0].children
|
||||
assert header[0].header is True
|
||||
assert header[0].merge_h == "restart"
|
||||
assert [c.merge_h for c in header[1:]] == ["continue", "continue", "continue"]
|
||||
body = t.children[1].children
|
||||
assert [c.merge_h for c in body] == ["none", "none", "none", "none"]
|
||||
|
||||
|
||||
def test_parse_lt_colspan_in_body():
|
||||
doc = markdown.parse(SAMPLE_LT_BODY)
|
||||
t = next(c for c in doc.children if isinstance(c, MdTable))
|
||||
data = t.children[1].children
|
||||
assert data[0].merge_h == "restart"
|
||||
assert data[1].merge_h == "continue"
|
||||
assert data[2].merge_h == "none"
|
||||
|
||||
|
||||
def test_apply_cell_merge_oxml():
|
||||
doc = Document()
|
||||
table = create_table(doc, 0, 2, doc.sections[0].page_width)
|
||||
@@ -153,6 +186,17 @@ def test_checker_merge_col_error():
|
||||
def test_checker_merge_ok():
|
||||
issues = check_table_merge(SAMPLE_ROWSPAN)
|
||||
assert issues == []
|
||||
assert check_table_merge(SAMPLE_LT_HEADER) == []
|
||||
|
||||
|
||||
def test_checker_lt_first_column():
|
||||
bad = """\
|
||||
| A | B |
|
||||
|---|---|
|
||||
| < | 2 |
|
||||
"""
|
||||
issues = check_table_merge(bad)
|
||||
assert any(i.id == "table.merge_col" for i in issues)
|
||||
|
||||
|
||||
def test_table_continuation_modes():
|
||||
|
||||
Reference in New Issue
Block a user