diff options
author | Martin Vilcans <martin@librador.com> | 2011-09-08 23:51:53 +0200 |
---|---|---|
committer | Martin Vilcans <martin@librador.com> | 2011-09-09 00:00:26 +0200 |
commit | 56551b10935c9027d8e1178430f7d8e82e078150 (patch) | |
tree | b1c526c1655aed484e450d944464c7be0e8a7011 /tests | |
parent | 579fa278aeaa26dccbdfe28b4b5ce0db3390c0b8 (diff) | |
download | screenplain-56551b10935c9027d8e1178430f7d8e82e078150.tar.gz |
Heed hard line breaks, per the SPMD spec.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/spmd_test.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/spmd_test.py b/tests/spmd_test.py index cb349a1..b66c478 100644 --- a/tests/spmd_test.py +++ b/tests/spmd_test.py @@ -148,5 +148,42 @@ class ParseTests(unittest2.TestCase): ])) self.assertEquals([Action, Action, Action], [type(p) for p in paras]) + def test_multiline_paragraph(self): + """Check that we don't join lines like Markdown does. + """ + paras = list(parse([ + 'They drink long and well from the beers.', + '', + "And then there's a long beat.", + "Longer than is funny. ", + " Long enough to be depressing.", + '', + 'The men look at each other.', + ])) + self.assertEquals([Action, Action, Action], [type(p) for p in paras]) + self.assertEquals( + [ + "And then there's a long beat.", + "Longer than is funny.", + "Long enough to be depressing.", + ], paras[1].lines + ) + + def test_multiline_dialog(self): + paras = list(parse([ + 'JULIET', + 'O Romeo, Romeo! wherefore art thou Romeo?', + ' Deny thy father and refuse thy name; ', + 'Or, if thou wilt not, be but sworn my love,', + " And I'll no longer be a Capulet.", + ])) + self.assertEquals([Dialog], [type(p) for p in paras]) + self.assertEquals([ + (False, 'O Romeo, Romeo! wherefore art thou Romeo?'), + (False, 'Deny thy father and refuse thy name;'), + (False, 'Or, if thou wilt not, be but sworn my love,'), + (False, "And I'll no longer be a Capulet."), + ], paras[0].blocks) + if __name__ == '__main__': unittest2.main() |