aboutsummaryrefslogtreecommitdiffstats
path: root/tests/spmd_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/spmd_test.py')
-rw-r--r--tests/spmd_test.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/spmd_test.py b/tests/spmd_test.py
index 21f39ae..aac8df9 100644
--- a/tests/spmd_test.py
+++ b/tests/spmd_test.py
@@ -4,7 +4,9 @@
import unittest2
from screenplain.parsers.spmd import parse
-from screenplain.types import Slug, Action, Dialog, DualDialog, Transition
+from screenplain.types import (
+ Slug, Action, Dialog, DualDialog, Transition, Section
+)
from screenplain.richstring import plain, italic, empty_string
@@ -80,6 +82,18 @@ class ParseTests(unittest2.TestCase):
paras[0].line
)
+ def test_section_parsed_correctly(self):
+ paras = parse([
+ '# first level',
+ '',
+ '## second level',
+ ])
+ self.assertEquals([Section, Section], [type(p) for p in paras])
+ self.assertEquals(1, paras[0].level)
+ self.assertEquals(plain('first level'), paras[0].text)
+ self.assertEquals(2, paras[1].level)
+ self.assertEquals(plain('second level'), paras[1].text)
+
# A Character element is any line entirely in caps, with one empty
# line before it and without an empty line after it.
def test_all_caps_is_character(self):