diff options
author | Martin Vilcans <martin@librador.com> | 2015-11-17 08:49:32 +0100 |
---|---|---|
committer | Martin Vilcans <martin@librador.com> | 2015-11-17 08:49:32 +0100 |
commit | d4a721b470a960e71a683b8ebff61b26c868d1cd (patch) | |
tree | 4468ee69a0620e04e777aaf3b1997b6d7a3517cd /tests | |
parent | f52103e567f18c652b8b9f28bbe8a1d754a78471 (diff) | |
download | screenplain-d4a721b470a960e71a683b8ebff61b26c868d1cd.tar.gz |
Support non-alphanumeric character names with "@"
Fixes #22
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fountain_test.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/fountain_test.py b/tests/fountain_test.py index 9a5d308..95a4a81 100644 --- a/tests/fountain_test.py +++ b/tests/fountain_test.py @@ -148,8 +148,10 @@ class DialogTests(TestCase): self.assertEquals(Dialog, type(dialog)) self.assertEquals(plain('SOME GUY'), dialog.character) - # Fountain would not be able to support a character named "23". We - # might need a syntax to force a character element. + + # Spec http://fountain.io/syntax#section-character: + # Character names must include at least one alphabetical character. + # "R2D2" works, but "23" does not. def test_nonalpha_character(self): paras = parse([ '23', @@ -157,6 +159,16 @@ class DialogTests(TestCase): ]) self.assertEquals([Action], [type(p) for p in paras]) + # Spec http://fountain.io/syntax#section-character: + # You can force a Character element by preceding it with the "at" symbol @. + def test_at_sign_forces_dialog(self): + paras = parse([ + '@McCLANE', + 'Yippee ki-yay', + ]) + self.assertEquals([Dialog], [type(p) for p in paras]) + self.assertEquals(plain('McCLANE'), paras[0].character) + def test_twospaced_line_is_not_character(self): paras = parse([ 'SCANNING THE AISLES... ', |