aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Vilcans <martin@librador.com>2011-12-16 20:53:09 +0100
committerMartin Vilcans <martin@librador.com>2011-12-16 23:05:17 +0100
commit1fc5cb7fe743133470c32fa4d0a13666c6735b05 (patch)
treebbcb16bdcfc333ee0b9bef1c7c0d3629b7fc46fb /tests
parent92b56357798394415ae17d4a7253b111be91e01f (diff)
downloadscreenplain-1fc5cb7fe743133470c32fa4d0a13666c6735b05.tar.gz
A line with two spaces inside dialog keeps the dialog together.
Fixed according to spec.
Diffstat (limited to 'tests')
-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 28078c0..2efa2d4 100644
--- a/tests/spmd_test.py
+++ b/tests/spmd_test.py
@@ -5,7 +5,7 @@
import unittest2
from screenplain.parsers.spmd import parse
from screenplain.types import Slug, Action, Dialog, DualDialog, Transition
-from screenplain.richstring import plain
+from screenplain.richstring import plain, empty_string
class ParseTests(unittest2.TestCase):
@@ -100,6 +100,20 @@ class ParseTests(unittest2.TestCase):
dialog.blocks[1]
)
+ def test_twospace_keeps_dialog_together(self):
+ paras = list(parse([
+ 'SOMEONE',
+ 'One',
+ ' ',
+ 'Two',
+ ]))
+ self.assertEquals([Dialog], [type(p) for p in paras])
+ self.assertEquals([
+ (False, plain('One')),
+ (False, empty_string),
+ (False, plain('Two')),
+ ], paras[0].blocks)
+
def test_dual_dialog(self):
paras = list(parse([
'BRICK',