Browse Source

[WIP] add an html test (failing)

pull/112/head
Oliverpool 9 years ago
parent
commit
20310279c5
  1. 1
      patacrep/songs/chordpro/data/html/content_newline
  2. 8
      patacrep/songs/chordpro/data/html/content_verse
  3. 50
      test/test_chordpro/newline.html
  4. 1
      test/test_chordpro/test_parser.py

1
patacrep/songs/chordpro/data/html/content_newline

@ -1 +0,0 @@
<br/>

8
patacrep/songs/chordpro/data/html/content_verse

@ -1,6 +1,8 @@
<p class="(( content.type ))">
(*- for line in content.lines -*)
(* if not loop.first *)<br>(* endif -*)
(* for line in content.lines *)
(( render(line) ))
(* endfor -*)
(*- if not loop.last *)<br>
(* endif *)
(* endfor *)
</p>

50
test/test_chordpro/newline.html

@ -0,0 +1,50 @@
<span class="song-language">Language: english</span><br>
<div class="song_content">
<p class="verse">
This is a verse<br>
With a new line<br>
<br>
The second part of the verse<br>
Is this line
</p>
<p class="verse">
Here is a new line at the end<br>
</p>
<p class="verse">
Foo bar
</p>
<p class="verse">
<br>
And a new line<br>
At the beginning
</p>
<p class="chorus">
New lines can also<br>
<br>
Be in chorus
</p>
<p class="bridge">
New lines can also<br>
<br>
Be in bridges
</p>
<p class="verse">
New lines can also<br>
<br>
Be surrounded by spaces
</p>
<p class="verse">
New lines can't appear in the middle of a line
</p>
</div>

1
test/test_chordpro/test_parser.py

@ -14,6 +14,7 @@ from .. import disable_logging
LANGUAGES = {
'tex': 'latex',
'sgc': 'chordpro',
'html': 'html',
}
class FileTestMeta(type):

Loading…
Cancel
Save