-
Notifications
You must be signed in to change notification settings - Fork 643
/
Copy pathtest_footnotes.py
78 lines (56 loc) · 1.47 KB
/
test_footnotes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from MarkdownEditing.tests import DereferrablePanelTestCase
class TestMdeReferenceNewFootnoteCommand(DereferrablePanelTestCase):
def test_new_footnote_in_first_line(self):
self.setBlockText(
"""
# Test 1
First inline.
Second inline.
Third inline.
# Test 2
paragraph
"""
)
self.setCaretTo(3,6)
self.view.run_command("mde_reference_new_footnote")
self.assertEqualBlockText(
"""
# Test 1
First[^1] inline.
Second inline.
Third inline.
# Test 2
paragraph
[^1]:\x20
"""
)
def test_new_footnote_in_second_line(self):
self.setBlockText(
"""
# Test 1
First[^1] inline.
Second inline.
Third inline.
# Test 2
paragraph
[^1]:
Footnote text
with second line
"""
)
self.setCaretTo(4,7)
self.view.run_command("mde_reference_new_footnote")
self.assertEqualBlockText(
"""
# Test 1
First[^1] inline.
Second[^2] inline.
Third inline.
# Test 2
paragraph
[^1]:
Footnote text
with second line
[^2]:\x20
"""
)