Esempio n. 1
0
def test_2_lines_together():
    marker_pattern = r"\s*(?P<mark>\[\s*(?P<marknum>\d+)\s*\])"
    refs = [
        u"[1] hello",
        u"hello2 [2] foo",
    ]
    rebuilt_refs = rebuild_reference_lines(refs, marker_pattern)
    assert rebuilt_refs == [
        u"[1] hello hello2",
        u"[2] foo",
    ]
Esempio n. 2
0
def test_2_lines_together():
    marker_pattern = ur"\s*(?P<mark>\[\s*(?P<marknum>\d+)\s*\])"
    refs = [
        u"[1] hello",
        u"hello2 [2] foo",
    ]
    rebuilt_refs = rebuild_reference_lines(refs, marker_pattern)
    assert rebuilt_refs == [
        u"[1] hello hello2",
        u"[2] foo",
    ]
Esempio n. 3
0
def test_simple():
    marker_pattern = ur"^\s*(?P<mark>\[\s*(?P<marknum>\d+)\s*\])"
    refs = [
        u"[1] hello",
        u"hello2",
        u"[2] foo",
    ]
    rebuilt_refs = rebuild_reference_lines(refs, marker_pattern)
    assert rebuilt_refs == [
        u"[1] hello hello2",
        u"[2] foo",
    ]
Esempio n. 4
0
def test_pagination_non_removal():
    marker_pattern = r"^\s*(?P<mark>\[\s*(?P<marknum>\d+)\s*\])"
    refs = [
        u"[1] hello",
        u"hello2",
        u"[2]",
        u"foo",
    ]
    rebuilt_refs = rebuild_reference_lines(refs, marker_pattern)
    assert rebuilt_refs == [
        u"[1] hello hello2",
        u"[2] foo",
    ]
Esempio n. 5
0
def test_pagination_non_removal():
    marker_pattern = ur"^\s*(?P<mark>\[\s*(?P<marknum>\d+)\s*\])"
    refs = [
        u"[1] hello",
        u"hello2",
        u"[2]",
        u"foo",
    ]
    rebuilt_refs = rebuild_reference_lines(refs, marker_pattern)
    assert rebuilt_refs == [
        u"[1] hello hello2",
        u"[2] foo",
    ]