@@ 73-81 (lines=9) @@ | ||
70 | ] |
|
71 | } |
|
72 | ||
73 | def test_latex(): |
|
74 | init() |
|
75 | ||
76 | src = json.loads(json.dumps(Span(['exercise:1', [], []], [Str(u'Exercise'), Space(), Str(u'1')]))) |
|
77 | latex = '\\phantomsection\\addcontentsline{exercise}{figure}{Exercise 1}' |
|
78 | dest = json.loads(json.dumps(Span(['exercise:1', [], []], [RawInline('tex', latex), Str(u'Exercise'), Space(), Str(u'1')]))) |
|
79 | assert pandoc_listof.collect(src['t'], src['c'], 'latex', {}) == None |
|
80 | assert json.loads(json.dumps(src)) == dest |
|
81 | assert pandoc_listof.collections == {'exercise': [{'identifier': u'1', 'text': u'Exercise 1'}]} |
|
82 | ||
83 | def test_headers_latex(): |
|
84 | init() |
|
@@ 12-19 (lines=8) @@ | ||
9 | pandoc_listof.collections = {} |
|
10 | pandoc_listof.headers = [0, 0, 0, 0, 0, 0] |
|
11 | ||
12 | def test_classic(): |
|
13 | init() |
|
14 | ||
15 | src = json.loads(json.dumps(Span(['exercise:1', [], []], [Str(u'Exercise'), Space(), Str(u'1')]))) |
|
16 | dest = json.loads(json.dumps(Span(['exercise:1', [], []], [Str(u'Exercise'), Space(), Str(u'1')]))) |
|
17 | assert pandoc_listof.collect(src['t'], src['c'], '', {}) == None |
|
18 | assert src == dest |
|
19 | assert pandoc_listof.collections == {'exercise': [{'identifier': u'1', 'text': u'Exercise 1'}]} |
|
20 | ||
21 | def test_headers(): |
|
22 | init() |