Browse Source

fix newline tests

content_repeat
oliverpool 8 years ago
parent
commit
865e980579
  1. 2
      patacrep/songs/chordpro/ast.py
  2. 3
      patacrep/songs/chordpro/syntax.py
  3. 6
      test/test_patatools/test_convert.py
  4. 2
      test/test_song/newline.crlf.csg
  5. 2
      test/test_song/newline.crlf.html
  6. 2
      test/test_song/newline.crlf.tsg
  7. 2
      test/test_song/newline.csg
  8. 2
      test/test_song/newline.html
  9. 2
      test/test_song/newline.tsg

2
patacrep/songs/chordpro/ast.py

@ -388,7 +388,7 @@ class VerseDirective(Directive):
def __init__(self, keyword, argument=None):
if keyword not in VERSE_DIRECTIVES:
#TODO Raise better exception
raise Exception
raise Exception(keyword)
super().__init__(keyword, argument)
@property

3
patacrep/songs/chordpro/syntax.py

@ -262,7 +262,8 @@ class ChordproParser(Parser):
keyword = symbols[3]
argument = symbols[4]
symbols[0] = ast.VerseDirective(keyword, argument)
if keyword != "newline":
symbols[0] = ast.VerseDirective(keyword, argument)
@staticmethod
def p_directive_next(symbols):

6
test/test_patatools/test_convert.py

@ -70,10 +70,8 @@ class TestConvert(unittest.TestCase, metaclass=dynamic.DynamicTest):
with logging_reduced():
if os.path.exists(destname):
os.remove(destname)
self.assertEqual(
self._system(main, args + [in_format, out_format, sourcename]),
1,
)
with self.assertRaises(Exception):
self._system(main, args + [in_format, out_format, sourcename])
@staticmethod
@contextlib.contextmanager

2
test/test_song/newline.crlf.csg

@ -38,4 +38,4 @@ New lines can also
Be surrounded by spaces
New lines cannot
New lines cannot appear in the middle of a line

2
test/test_song/newline.crlf.html

@ -38,6 +38,6 @@ Be in bridges
Be surrounded by spaces
</p>
<p class="verse">New lines cannot
<p class="verse">New lines cannot appear in the middle of a line
</p>
</div>

2
test/test_song/newline.crlf.tsg

@ -55,7 +55,7 @@
\begin{verse}
New lines cannot
New lines cannot appear in the middle of a line
\end{verse}
\endsong

2
test/test_song/newline.csg

@ -38,4 +38,4 @@ New lines can also
Be surrounded by spaces
New lines cannot
New lines cannot appear in the middle of a line

2
test/test_song/newline.html

@ -38,6 +38,6 @@ Be in bridges
Be surrounded by spaces
</p>
<p class="verse">New lines cannot
<p class="verse">New lines cannot appear in the middle of a line
</p>
</div>

2
test/test_song/newline.tsg

@ -55,7 +55,7 @@
\begin{verse}
New lines cannot
New lines cannot appear in the middle of a line
\end{verse}
\endsong

Loading…
Cancel
Save