From 11f49258d3a39c91d62879c00597ff552b9bb9e2 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Fri, 13 Nov 2015 10:46:31 +0100 Subject: [PATCH] Change test_parser extensions --- patacrep/songs/chordpro/__init__.py | 10 +-- test/test_chordpro/{00.sgc => 00.csg} | 0 .../{00.source => 00.csg.source} | 0 test/test_chordpro/{00.tex => 00.tsg} | 0 test/test_chordpro/{01.sgc => 01.csg} | 0 .../{01.source => 01.csg.source} | 0 test/test_chordpro/{01.tex => 01.tsg} | 0 test/test_chordpro/{02.sgc => 02.csg} | 0 .../{02.source => 02.csg.source} | 0 test/test_chordpro/{02.tex => 02.tsg} | 0 test/test_chordpro/{03.sgc => 03.csg} | 0 .../{03.source => 03.csg.source} | 0 test/test_chordpro/{03.tex => 03.tsg} | 0 test/test_chordpro/{04.sgc => 04.csg} | 0 .../{04.source => 04.csg.source} | 0 test/test_chordpro/{04.tex => 04.tsg} | 0 test/test_chordpro/{05.sgc => 05.csg} | 0 .../{05.source => 05.csg.source} | 0 test/test_chordpro/{05.tex => 05.tsg} | 0 test/test_chordpro/{06.sgc => 06.csg} | 0 .../{06.source => 06.csg.source} | 0 test/test_chordpro/{06.tex => 06.tsg} | 0 test/test_chordpro/{07.sgc => 07.csg} | 0 .../{07.source => 07.csg.source} | 0 test/test_chordpro/{07.tex => 07.tsg} | 0 test/test_chordpro/{08.sgc => 08.csg} | 0 .../{08.source => 08.csg.source} | 0 test/test_chordpro/{08.tex => 08.tsg} | 0 test/test_chordpro/{09.sgc => 09.csg} | 0 .../{09.source => 09.csg.source} | 0 test/test_chordpro/{09.tex => 09.tsg} | 0 test/test_chordpro/{10.sgc => 10.csg} | 0 .../{10.source => 10.csg.source} | 0 test/test_chordpro/{10.tex => 10.tsg} | 0 test/test_chordpro/{11.sgc => 11.csg} | 0 .../{11.source => 11.csg.source} | 0 test/test_chordpro/{11.tex => 11.tsg} | 0 test/test_chordpro/{12.sgc => 12.csg} | 0 .../{12.source => 12.csg.source} | 0 test/test_chordpro/{12.tex => 12.tsg} | 0 test/test_chordpro/{13.sgc => 13.csg} | 0 .../{13.source => 13.csg.source} | 0 test/test_chordpro/{13.tex => 13.tsg} | 0 test/test_chordpro/{21.sgc => 21.csg} | 0 .../{21.source => 21.csg.source} | 0 test/test_chordpro/{21.tex => 21.tsg} | 0 test/test_chordpro/{22.sgc => 22.csg} | 0 .../{22.source => 22.csg.source} | 0 test/test_chordpro/{22.tex => 22.tsg} | 0 test/test_chordpro/{23.sgc => 23.csg} | 0 .../{23.source => 23.csg.source} | 0 test/test_chordpro/{23.tex => 23.tsg} | 0 test/test_chordpro/{24.sgc => 24.csg} | 0 .../{24.source => 24.csg.source} | 0 test/test_chordpro/{24.tex => 24.tsg} | 0 test/test_chordpro/{25.sgc => 25.csg} | 0 .../{25.source => 25.csg.source} | 0 test/test_chordpro/{25.tex => 25.tsg} | 0 test/test_chordpro/{26.sgc => 26.csg} | 0 .../{26.source => 26.csg.source} | 0 test/test_chordpro/{26.tex => 26.tsg} | 0 test/test_chordpro/{27.sgc => 27.csg} | 0 .../{27.source => 27.csg.source} | 0 test/test_chordpro/{27.tex => 27.tsg} | 0 test/test_chordpro/{28.sgc => 28.csg} | 0 .../{28.source => 28.csg.source} | 0 test/test_chordpro/{28.tex => 28.tsg} | 0 test/test_chordpro/{29.sgc => 29.csg} | 0 .../{29.source => 29.csg.source} | 0 test/test_chordpro/{29.tex => 29.tsg} | 0 .../{author_names.sgc => author_names.csg} | 0 ...r_names.source => author_names.csg.source} | 0 .../{author_names.tex => author_names.tsg} | 0 test/test_chordpro/{chords.sgc => chords.csg} | 0 .../{chords.source => chords.csg.source} | 0 test/test_chordpro/{chords.tex => chords.tsg} | 0 .../{customchords.sgc => customchords.csg} | 0 ...mchords.source => customchords.csg.source} | 0 .../{customchords.tex => customchords.tsg} | 0 ...tent.source => invalid_content.csg.source} | 0 .../{greensleeves.sgc => greensleeves.csg} | 0 ...sleeves.source => greensleeves.csg.source} | 0 .../{greensleeves.tex => greensleeves.tsg} | 0 .../{invalid_chord.sgc => invalid_chord.csg} | 0 ..._chord.source => invalid_chord.csg.source} | 0 .../{invalid_chord.tex => invalid_chord.tsg} | 0 ...ustomchord.sgc => invalid_customchord.csg} | 0 ....source => invalid_customchord.csg.source} | 0 ...ustomchord.tex => invalid_customchord.tsg} | 0 ...id_directive.sgc => invalid_directive.csg} | 0 ...ve.source => invalid_directive.csg.source} | 0 ...id_directive.tex => invalid_directive.tsg} | 0 test/test_chordpro/{lang.sgc => lang.csg} | 0 .../{lang.source => lang.csg.source} | 0 .../{metadata.sgc => metadata.csg} | 0 .../{metadata.source => metadata.csg.source} | 0 .../{metadata.tex => metadata.tsg} | 0 .../{newline.crlf.sgc => newline.crlf.csg} | 0 test/test_chordpro/newline.crlf.csg.source | 2 + test/test_chordpro/newline.crlf.source | 2 - .../{newline.crlf.tex => newline.crlf.tsg} | 0 .../{newline.sgc => newline.csg} | 0 .../{newline.source => newline.csg.source} | 0 .../{newline.tex => newline.tsg} | 0 .../{nolyrics.sgc => nolyrics.csg} | 0 .../{nolyrics.source => nolyrics.csg.source} | 0 .../{nolyrics.tex => nolyrics.tsg} | 0 test/test_chordpro/{tags.sgc => tags.csg} | 0 .../{tags.source => tags.csg.source} | 0 test/test_chordpro/{tags.tex => tags.tsg} | 0 test/test_chordpro/test_parser.py | 69 +++++++++---------- .../{ukulelechords.sgc => ukulelechords.csg} | 0 ...chords.source => ukulelechords.csg.source} | 0 .../{ukulelechords.tex => ukulelechords.tsg} | 0 114 files changed, 41 insertions(+), 42 deletions(-) rename test/test_chordpro/{00.sgc => 00.csg} (100%) rename test/test_chordpro/{00.source => 00.csg.source} (100%) rename test/test_chordpro/{00.tex => 00.tsg} (100%) rename test/test_chordpro/{01.sgc => 01.csg} (100%) rename test/test_chordpro/{01.source => 01.csg.source} (100%) rename test/test_chordpro/{01.tex => 01.tsg} (100%) rename test/test_chordpro/{02.sgc => 02.csg} (100%) rename test/test_chordpro/{02.source => 02.csg.source} (100%) rename test/test_chordpro/{02.tex => 02.tsg} (100%) rename test/test_chordpro/{03.sgc => 03.csg} (100%) rename test/test_chordpro/{03.source => 03.csg.source} (100%) rename test/test_chordpro/{03.tex => 03.tsg} (100%) rename test/test_chordpro/{04.sgc => 04.csg} (100%) rename test/test_chordpro/{04.source => 04.csg.source} (100%) rename test/test_chordpro/{04.tex => 04.tsg} (100%) rename test/test_chordpro/{05.sgc => 05.csg} (100%) rename test/test_chordpro/{05.source => 05.csg.source} (100%) rename test/test_chordpro/{05.tex => 05.tsg} (100%) rename test/test_chordpro/{06.sgc => 06.csg} (100%) rename test/test_chordpro/{06.source => 06.csg.source} (100%) rename test/test_chordpro/{06.tex => 06.tsg} (100%) rename test/test_chordpro/{07.sgc => 07.csg} (100%) rename test/test_chordpro/{07.source => 07.csg.source} (100%) rename test/test_chordpro/{07.tex => 07.tsg} (100%) rename test/test_chordpro/{08.sgc => 08.csg} (100%) rename test/test_chordpro/{08.source => 08.csg.source} (100%) rename test/test_chordpro/{08.tex => 08.tsg} (100%) rename test/test_chordpro/{09.sgc => 09.csg} (100%) rename test/test_chordpro/{09.source => 09.csg.source} (100%) rename test/test_chordpro/{09.tex => 09.tsg} (100%) rename test/test_chordpro/{10.sgc => 10.csg} (100%) rename test/test_chordpro/{10.source => 10.csg.source} (100%) rename test/test_chordpro/{10.tex => 10.tsg} (100%) rename test/test_chordpro/{11.sgc => 11.csg} (100%) rename test/test_chordpro/{11.source => 11.csg.source} (100%) rename test/test_chordpro/{11.tex => 11.tsg} (100%) rename test/test_chordpro/{12.sgc => 12.csg} (100%) rename test/test_chordpro/{12.source => 12.csg.source} (100%) rename test/test_chordpro/{12.tex => 12.tsg} (100%) rename test/test_chordpro/{13.sgc => 13.csg} (100%) rename test/test_chordpro/{13.source => 13.csg.source} (100%) rename test/test_chordpro/{13.tex => 13.tsg} (100%) rename test/test_chordpro/{21.sgc => 21.csg} (100%) rename test/test_chordpro/{21.source => 21.csg.source} (100%) rename test/test_chordpro/{21.tex => 21.tsg} (100%) rename test/test_chordpro/{22.sgc => 22.csg} (100%) rename test/test_chordpro/{22.source => 22.csg.source} (100%) rename test/test_chordpro/{22.tex => 22.tsg} (100%) rename test/test_chordpro/{23.sgc => 23.csg} (100%) rename test/test_chordpro/{23.source => 23.csg.source} (100%) rename test/test_chordpro/{23.tex => 23.tsg} (100%) rename test/test_chordpro/{24.sgc => 24.csg} (100%) rename test/test_chordpro/{24.source => 24.csg.source} (100%) rename test/test_chordpro/{24.tex => 24.tsg} (100%) rename test/test_chordpro/{25.sgc => 25.csg} (100%) rename test/test_chordpro/{25.source => 25.csg.source} (100%) rename test/test_chordpro/{25.tex => 25.tsg} (100%) rename test/test_chordpro/{26.sgc => 26.csg} (100%) rename test/test_chordpro/{26.source => 26.csg.source} (100%) rename test/test_chordpro/{26.tex => 26.tsg} (100%) rename test/test_chordpro/{27.sgc => 27.csg} (100%) rename test/test_chordpro/{27.source => 27.csg.source} (100%) rename test/test_chordpro/{27.tex => 27.tsg} (100%) rename test/test_chordpro/{28.sgc => 28.csg} (100%) rename test/test_chordpro/{28.source => 28.csg.source} (100%) rename test/test_chordpro/{28.tex => 28.tsg} (100%) rename test/test_chordpro/{29.sgc => 29.csg} (100%) rename test/test_chordpro/{29.source => 29.csg.source} (100%) rename test/test_chordpro/{29.tex => 29.tsg} (100%) rename test/test_chordpro/{author_names.sgc => author_names.csg} (100%) rename test/test_chordpro/{author_names.source => author_names.csg.source} (100%) rename test/test_chordpro/{author_names.tex => author_names.tsg} (100%) rename test/test_chordpro/{chords.sgc => chords.csg} (100%) rename test/test_chordpro/{chords.source => chords.csg.source} (100%) rename test/test_chordpro/{chords.tex => chords.tsg} (100%) rename test/test_chordpro/{customchords.sgc => customchords.csg} (100%) rename test/test_chordpro/{customchords.source => customchords.csg.source} (100%) rename test/test_chordpro/{customchords.tex => customchords.tsg} (100%) rename test/test_chordpro/errors/{invalid_content.source => invalid_content.csg.source} (100%) rename test/test_chordpro/{greensleeves.sgc => greensleeves.csg} (100%) rename test/test_chordpro/{greensleeves.source => greensleeves.csg.source} (100%) rename test/test_chordpro/{greensleeves.tex => greensleeves.tsg} (100%) rename test/test_chordpro/{invalid_chord.sgc => invalid_chord.csg} (100%) rename test/test_chordpro/{invalid_chord.source => invalid_chord.csg.source} (100%) rename test/test_chordpro/{invalid_chord.tex => invalid_chord.tsg} (100%) rename test/test_chordpro/{invalid_customchord.sgc => invalid_customchord.csg} (100%) rename test/test_chordpro/{invalid_customchord.source => invalid_customchord.csg.source} (100%) rename test/test_chordpro/{invalid_customchord.tex => invalid_customchord.tsg} (100%) rename test/test_chordpro/{invalid_directive.sgc => invalid_directive.csg} (100%) rename test/test_chordpro/{invalid_directive.source => invalid_directive.csg.source} (100%) rename test/test_chordpro/{invalid_directive.tex => invalid_directive.tsg} (100%) rename test/test_chordpro/{lang.sgc => lang.csg} (100%) rename test/test_chordpro/{lang.source => lang.csg.source} (100%) rename test/test_chordpro/{metadata.sgc => metadata.csg} (100%) rename test/test_chordpro/{metadata.source => metadata.csg.source} (100%) rename test/test_chordpro/{metadata.tex => metadata.tsg} (100%) rename test/test_chordpro/{newline.crlf.sgc => newline.crlf.csg} (100%) create mode 100644 test/test_chordpro/newline.crlf.csg.source delete mode 100644 test/test_chordpro/newline.crlf.source rename test/test_chordpro/{newline.crlf.tex => newline.crlf.tsg} (100%) rename test/test_chordpro/{newline.sgc => newline.csg} (100%) rename test/test_chordpro/{newline.source => newline.csg.source} (100%) rename test/test_chordpro/{newline.tex => newline.tsg} (100%) rename test/test_chordpro/{nolyrics.sgc => nolyrics.csg} (100%) rename test/test_chordpro/{nolyrics.source => nolyrics.csg.source} (100%) rename test/test_chordpro/{nolyrics.tex => nolyrics.tsg} (100%) rename test/test_chordpro/{tags.sgc => tags.csg} (100%) rename test/test_chordpro/{tags.source => tags.csg.source} (100%) rename test/test_chordpro/{tags.tex => tags.tsg} (100%) rename test/test_chordpro/{ukulelechords.sgc => ukulelechords.csg} (100%) rename test/test_chordpro/{ukulelechords.source => ukulelechords.csg.source} (100%) rename test/test_chordpro/{ukulelechords.tex => ukulelechords.tsg} (100%) diff --git a/patacrep/songs/chordpro/__init__.py b/patacrep/songs/chordpro/__init__.py index 330b2f3e..5777b170 100644 --- a/patacrep/songs/chordpro/__init__.py +++ b/patacrep/songs/chordpro/__init__.py @@ -131,13 +131,13 @@ class Chordpro2ChordproSong(ChordproSong): return filename SONG_RENDERERS = { - "latex": { - 'sgc': Chordpro2LatexSong, + "tsg": { + 'csg': Chordpro2LatexSong, }, "html": { - 'sgc': Chordpro2HtmlSong, + 'csg': Chordpro2HtmlSong, }, - "chordpro": { - 'sgc': Chordpro2ChordproSong, + "csg": { + 'csg': Chordpro2ChordproSong, }, } diff --git a/test/test_chordpro/00.sgc b/test/test_chordpro/00.csg similarity index 100% rename from test/test_chordpro/00.sgc rename to test/test_chordpro/00.csg diff --git a/test/test_chordpro/00.source b/test/test_chordpro/00.csg.source similarity index 100% rename from test/test_chordpro/00.source rename to test/test_chordpro/00.csg.source diff --git a/test/test_chordpro/00.tex b/test/test_chordpro/00.tsg similarity index 100% rename from test/test_chordpro/00.tex rename to test/test_chordpro/00.tsg diff --git a/test/test_chordpro/01.sgc b/test/test_chordpro/01.csg similarity index 100% rename from test/test_chordpro/01.sgc rename to test/test_chordpro/01.csg diff --git a/test/test_chordpro/01.source b/test/test_chordpro/01.csg.source similarity index 100% rename from test/test_chordpro/01.source rename to test/test_chordpro/01.csg.source diff --git a/test/test_chordpro/01.tex b/test/test_chordpro/01.tsg similarity index 100% rename from test/test_chordpro/01.tex rename to test/test_chordpro/01.tsg diff --git a/test/test_chordpro/02.sgc b/test/test_chordpro/02.csg similarity index 100% rename from test/test_chordpro/02.sgc rename to test/test_chordpro/02.csg diff --git a/test/test_chordpro/02.source b/test/test_chordpro/02.csg.source similarity index 100% rename from test/test_chordpro/02.source rename to test/test_chordpro/02.csg.source diff --git a/test/test_chordpro/02.tex b/test/test_chordpro/02.tsg similarity index 100% rename from test/test_chordpro/02.tex rename to test/test_chordpro/02.tsg diff --git a/test/test_chordpro/03.sgc b/test/test_chordpro/03.csg similarity index 100% rename from test/test_chordpro/03.sgc rename to test/test_chordpro/03.csg diff --git a/test/test_chordpro/03.source b/test/test_chordpro/03.csg.source similarity index 100% rename from test/test_chordpro/03.source rename to test/test_chordpro/03.csg.source diff --git a/test/test_chordpro/03.tex b/test/test_chordpro/03.tsg similarity index 100% rename from test/test_chordpro/03.tex rename to test/test_chordpro/03.tsg diff --git a/test/test_chordpro/04.sgc b/test/test_chordpro/04.csg similarity index 100% rename from test/test_chordpro/04.sgc rename to test/test_chordpro/04.csg diff --git a/test/test_chordpro/04.source b/test/test_chordpro/04.csg.source similarity index 100% rename from test/test_chordpro/04.source rename to test/test_chordpro/04.csg.source diff --git a/test/test_chordpro/04.tex b/test/test_chordpro/04.tsg similarity index 100% rename from test/test_chordpro/04.tex rename to test/test_chordpro/04.tsg diff --git a/test/test_chordpro/05.sgc b/test/test_chordpro/05.csg similarity index 100% rename from test/test_chordpro/05.sgc rename to test/test_chordpro/05.csg diff --git a/test/test_chordpro/05.source b/test/test_chordpro/05.csg.source similarity index 100% rename from test/test_chordpro/05.source rename to test/test_chordpro/05.csg.source diff --git a/test/test_chordpro/05.tex b/test/test_chordpro/05.tsg similarity index 100% rename from test/test_chordpro/05.tex rename to test/test_chordpro/05.tsg diff --git a/test/test_chordpro/06.sgc b/test/test_chordpro/06.csg similarity index 100% rename from test/test_chordpro/06.sgc rename to test/test_chordpro/06.csg diff --git a/test/test_chordpro/06.source b/test/test_chordpro/06.csg.source similarity index 100% rename from test/test_chordpro/06.source rename to test/test_chordpro/06.csg.source diff --git a/test/test_chordpro/06.tex b/test/test_chordpro/06.tsg similarity index 100% rename from test/test_chordpro/06.tex rename to test/test_chordpro/06.tsg diff --git a/test/test_chordpro/07.sgc b/test/test_chordpro/07.csg similarity index 100% rename from test/test_chordpro/07.sgc rename to test/test_chordpro/07.csg diff --git a/test/test_chordpro/07.source b/test/test_chordpro/07.csg.source similarity index 100% rename from test/test_chordpro/07.source rename to test/test_chordpro/07.csg.source diff --git a/test/test_chordpro/07.tex b/test/test_chordpro/07.tsg similarity index 100% rename from test/test_chordpro/07.tex rename to test/test_chordpro/07.tsg diff --git a/test/test_chordpro/08.sgc b/test/test_chordpro/08.csg similarity index 100% rename from test/test_chordpro/08.sgc rename to test/test_chordpro/08.csg diff --git a/test/test_chordpro/08.source b/test/test_chordpro/08.csg.source similarity index 100% rename from test/test_chordpro/08.source rename to test/test_chordpro/08.csg.source diff --git a/test/test_chordpro/08.tex b/test/test_chordpro/08.tsg similarity index 100% rename from test/test_chordpro/08.tex rename to test/test_chordpro/08.tsg diff --git a/test/test_chordpro/09.sgc b/test/test_chordpro/09.csg similarity index 100% rename from test/test_chordpro/09.sgc rename to test/test_chordpro/09.csg diff --git a/test/test_chordpro/09.source b/test/test_chordpro/09.csg.source similarity index 100% rename from test/test_chordpro/09.source rename to test/test_chordpro/09.csg.source diff --git a/test/test_chordpro/09.tex b/test/test_chordpro/09.tsg similarity index 100% rename from test/test_chordpro/09.tex rename to test/test_chordpro/09.tsg diff --git a/test/test_chordpro/10.sgc b/test/test_chordpro/10.csg similarity index 100% rename from test/test_chordpro/10.sgc rename to test/test_chordpro/10.csg diff --git a/test/test_chordpro/10.source b/test/test_chordpro/10.csg.source similarity index 100% rename from test/test_chordpro/10.source rename to test/test_chordpro/10.csg.source diff --git a/test/test_chordpro/10.tex b/test/test_chordpro/10.tsg similarity index 100% rename from test/test_chordpro/10.tex rename to test/test_chordpro/10.tsg diff --git a/test/test_chordpro/11.sgc b/test/test_chordpro/11.csg similarity index 100% rename from test/test_chordpro/11.sgc rename to test/test_chordpro/11.csg diff --git a/test/test_chordpro/11.source b/test/test_chordpro/11.csg.source similarity index 100% rename from test/test_chordpro/11.source rename to test/test_chordpro/11.csg.source diff --git a/test/test_chordpro/11.tex b/test/test_chordpro/11.tsg similarity index 100% rename from test/test_chordpro/11.tex rename to test/test_chordpro/11.tsg diff --git a/test/test_chordpro/12.sgc b/test/test_chordpro/12.csg similarity index 100% rename from test/test_chordpro/12.sgc rename to test/test_chordpro/12.csg diff --git a/test/test_chordpro/12.source b/test/test_chordpro/12.csg.source similarity index 100% rename from test/test_chordpro/12.source rename to test/test_chordpro/12.csg.source diff --git a/test/test_chordpro/12.tex b/test/test_chordpro/12.tsg similarity index 100% rename from test/test_chordpro/12.tex rename to test/test_chordpro/12.tsg diff --git a/test/test_chordpro/13.sgc b/test/test_chordpro/13.csg similarity index 100% rename from test/test_chordpro/13.sgc rename to test/test_chordpro/13.csg diff --git a/test/test_chordpro/13.source b/test/test_chordpro/13.csg.source similarity index 100% rename from test/test_chordpro/13.source rename to test/test_chordpro/13.csg.source diff --git a/test/test_chordpro/13.tex b/test/test_chordpro/13.tsg similarity index 100% rename from test/test_chordpro/13.tex rename to test/test_chordpro/13.tsg diff --git a/test/test_chordpro/21.sgc b/test/test_chordpro/21.csg similarity index 100% rename from test/test_chordpro/21.sgc rename to test/test_chordpro/21.csg diff --git a/test/test_chordpro/21.source b/test/test_chordpro/21.csg.source similarity index 100% rename from test/test_chordpro/21.source rename to test/test_chordpro/21.csg.source diff --git a/test/test_chordpro/21.tex b/test/test_chordpro/21.tsg similarity index 100% rename from test/test_chordpro/21.tex rename to test/test_chordpro/21.tsg diff --git a/test/test_chordpro/22.sgc b/test/test_chordpro/22.csg similarity index 100% rename from test/test_chordpro/22.sgc rename to test/test_chordpro/22.csg diff --git a/test/test_chordpro/22.source b/test/test_chordpro/22.csg.source similarity index 100% rename from test/test_chordpro/22.source rename to test/test_chordpro/22.csg.source diff --git a/test/test_chordpro/22.tex b/test/test_chordpro/22.tsg similarity index 100% rename from test/test_chordpro/22.tex rename to test/test_chordpro/22.tsg diff --git a/test/test_chordpro/23.sgc b/test/test_chordpro/23.csg similarity index 100% rename from test/test_chordpro/23.sgc rename to test/test_chordpro/23.csg diff --git a/test/test_chordpro/23.source b/test/test_chordpro/23.csg.source similarity index 100% rename from test/test_chordpro/23.source rename to test/test_chordpro/23.csg.source diff --git a/test/test_chordpro/23.tex b/test/test_chordpro/23.tsg similarity index 100% rename from test/test_chordpro/23.tex rename to test/test_chordpro/23.tsg diff --git a/test/test_chordpro/24.sgc b/test/test_chordpro/24.csg similarity index 100% rename from test/test_chordpro/24.sgc rename to test/test_chordpro/24.csg diff --git a/test/test_chordpro/24.source b/test/test_chordpro/24.csg.source similarity index 100% rename from test/test_chordpro/24.source rename to test/test_chordpro/24.csg.source diff --git a/test/test_chordpro/24.tex b/test/test_chordpro/24.tsg similarity index 100% rename from test/test_chordpro/24.tex rename to test/test_chordpro/24.tsg diff --git a/test/test_chordpro/25.sgc b/test/test_chordpro/25.csg similarity index 100% rename from test/test_chordpro/25.sgc rename to test/test_chordpro/25.csg diff --git a/test/test_chordpro/25.source b/test/test_chordpro/25.csg.source similarity index 100% rename from test/test_chordpro/25.source rename to test/test_chordpro/25.csg.source diff --git a/test/test_chordpro/25.tex b/test/test_chordpro/25.tsg similarity index 100% rename from test/test_chordpro/25.tex rename to test/test_chordpro/25.tsg diff --git a/test/test_chordpro/26.sgc b/test/test_chordpro/26.csg similarity index 100% rename from test/test_chordpro/26.sgc rename to test/test_chordpro/26.csg diff --git a/test/test_chordpro/26.source b/test/test_chordpro/26.csg.source similarity index 100% rename from test/test_chordpro/26.source rename to test/test_chordpro/26.csg.source diff --git a/test/test_chordpro/26.tex b/test/test_chordpro/26.tsg similarity index 100% rename from test/test_chordpro/26.tex rename to test/test_chordpro/26.tsg diff --git a/test/test_chordpro/27.sgc b/test/test_chordpro/27.csg similarity index 100% rename from test/test_chordpro/27.sgc rename to test/test_chordpro/27.csg diff --git a/test/test_chordpro/27.source b/test/test_chordpro/27.csg.source similarity index 100% rename from test/test_chordpro/27.source rename to test/test_chordpro/27.csg.source diff --git a/test/test_chordpro/27.tex b/test/test_chordpro/27.tsg similarity index 100% rename from test/test_chordpro/27.tex rename to test/test_chordpro/27.tsg diff --git a/test/test_chordpro/28.sgc b/test/test_chordpro/28.csg similarity index 100% rename from test/test_chordpro/28.sgc rename to test/test_chordpro/28.csg diff --git a/test/test_chordpro/28.source b/test/test_chordpro/28.csg.source similarity index 100% rename from test/test_chordpro/28.source rename to test/test_chordpro/28.csg.source diff --git a/test/test_chordpro/28.tex b/test/test_chordpro/28.tsg similarity index 100% rename from test/test_chordpro/28.tex rename to test/test_chordpro/28.tsg diff --git a/test/test_chordpro/29.sgc b/test/test_chordpro/29.csg similarity index 100% rename from test/test_chordpro/29.sgc rename to test/test_chordpro/29.csg diff --git a/test/test_chordpro/29.source b/test/test_chordpro/29.csg.source similarity index 100% rename from test/test_chordpro/29.source rename to test/test_chordpro/29.csg.source diff --git a/test/test_chordpro/29.tex b/test/test_chordpro/29.tsg similarity index 100% rename from test/test_chordpro/29.tex rename to test/test_chordpro/29.tsg diff --git a/test/test_chordpro/author_names.sgc b/test/test_chordpro/author_names.csg similarity index 100% rename from test/test_chordpro/author_names.sgc rename to test/test_chordpro/author_names.csg diff --git a/test/test_chordpro/author_names.source b/test/test_chordpro/author_names.csg.source similarity index 100% rename from test/test_chordpro/author_names.source rename to test/test_chordpro/author_names.csg.source diff --git a/test/test_chordpro/author_names.tex b/test/test_chordpro/author_names.tsg similarity index 100% rename from test/test_chordpro/author_names.tex rename to test/test_chordpro/author_names.tsg diff --git a/test/test_chordpro/chords.sgc b/test/test_chordpro/chords.csg similarity index 100% rename from test/test_chordpro/chords.sgc rename to test/test_chordpro/chords.csg diff --git a/test/test_chordpro/chords.source b/test/test_chordpro/chords.csg.source similarity index 100% rename from test/test_chordpro/chords.source rename to test/test_chordpro/chords.csg.source diff --git a/test/test_chordpro/chords.tex b/test/test_chordpro/chords.tsg similarity index 100% rename from test/test_chordpro/chords.tex rename to test/test_chordpro/chords.tsg diff --git a/test/test_chordpro/customchords.sgc b/test/test_chordpro/customchords.csg similarity index 100% rename from test/test_chordpro/customchords.sgc rename to test/test_chordpro/customchords.csg diff --git a/test/test_chordpro/customchords.source b/test/test_chordpro/customchords.csg.source similarity index 100% rename from test/test_chordpro/customchords.source rename to test/test_chordpro/customchords.csg.source diff --git a/test/test_chordpro/customchords.tex b/test/test_chordpro/customchords.tsg similarity index 100% rename from test/test_chordpro/customchords.tex rename to test/test_chordpro/customchords.tsg diff --git a/test/test_chordpro/errors/invalid_content.source b/test/test_chordpro/errors/invalid_content.csg.source similarity index 100% rename from test/test_chordpro/errors/invalid_content.source rename to test/test_chordpro/errors/invalid_content.csg.source diff --git a/test/test_chordpro/greensleeves.sgc b/test/test_chordpro/greensleeves.csg similarity index 100% rename from test/test_chordpro/greensleeves.sgc rename to test/test_chordpro/greensleeves.csg diff --git a/test/test_chordpro/greensleeves.source b/test/test_chordpro/greensleeves.csg.source similarity index 100% rename from test/test_chordpro/greensleeves.source rename to test/test_chordpro/greensleeves.csg.source diff --git a/test/test_chordpro/greensleeves.tex b/test/test_chordpro/greensleeves.tsg similarity index 100% rename from test/test_chordpro/greensleeves.tex rename to test/test_chordpro/greensleeves.tsg diff --git a/test/test_chordpro/invalid_chord.sgc b/test/test_chordpro/invalid_chord.csg similarity index 100% rename from test/test_chordpro/invalid_chord.sgc rename to test/test_chordpro/invalid_chord.csg diff --git a/test/test_chordpro/invalid_chord.source b/test/test_chordpro/invalid_chord.csg.source similarity index 100% rename from test/test_chordpro/invalid_chord.source rename to test/test_chordpro/invalid_chord.csg.source diff --git a/test/test_chordpro/invalid_chord.tex b/test/test_chordpro/invalid_chord.tsg similarity index 100% rename from test/test_chordpro/invalid_chord.tex rename to test/test_chordpro/invalid_chord.tsg diff --git a/test/test_chordpro/invalid_customchord.sgc b/test/test_chordpro/invalid_customchord.csg similarity index 100% rename from test/test_chordpro/invalid_customchord.sgc rename to test/test_chordpro/invalid_customchord.csg diff --git a/test/test_chordpro/invalid_customchord.source b/test/test_chordpro/invalid_customchord.csg.source similarity index 100% rename from test/test_chordpro/invalid_customchord.source rename to test/test_chordpro/invalid_customchord.csg.source diff --git a/test/test_chordpro/invalid_customchord.tex b/test/test_chordpro/invalid_customchord.tsg similarity index 100% rename from test/test_chordpro/invalid_customchord.tex rename to test/test_chordpro/invalid_customchord.tsg diff --git a/test/test_chordpro/invalid_directive.sgc b/test/test_chordpro/invalid_directive.csg similarity index 100% rename from test/test_chordpro/invalid_directive.sgc rename to test/test_chordpro/invalid_directive.csg diff --git a/test/test_chordpro/invalid_directive.source b/test/test_chordpro/invalid_directive.csg.source similarity index 100% rename from test/test_chordpro/invalid_directive.source rename to test/test_chordpro/invalid_directive.csg.source diff --git a/test/test_chordpro/invalid_directive.tex b/test/test_chordpro/invalid_directive.tsg similarity index 100% rename from test/test_chordpro/invalid_directive.tex rename to test/test_chordpro/invalid_directive.tsg diff --git a/test/test_chordpro/lang.sgc b/test/test_chordpro/lang.csg similarity index 100% rename from test/test_chordpro/lang.sgc rename to test/test_chordpro/lang.csg diff --git a/test/test_chordpro/lang.source b/test/test_chordpro/lang.csg.source similarity index 100% rename from test/test_chordpro/lang.source rename to test/test_chordpro/lang.csg.source diff --git a/test/test_chordpro/metadata.sgc b/test/test_chordpro/metadata.csg similarity index 100% rename from test/test_chordpro/metadata.sgc rename to test/test_chordpro/metadata.csg diff --git a/test/test_chordpro/metadata.source b/test/test_chordpro/metadata.csg.source similarity index 100% rename from test/test_chordpro/metadata.source rename to test/test_chordpro/metadata.csg.source diff --git a/test/test_chordpro/metadata.tex b/test/test_chordpro/metadata.tsg similarity index 100% rename from test/test_chordpro/metadata.tex rename to test/test_chordpro/metadata.tsg diff --git a/test/test_chordpro/newline.crlf.sgc b/test/test_chordpro/newline.crlf.csg similarity index 100% rename from test/test_chordpro/newline.crlf.sgc rename to test/test_chordpro/newline.crlf.csg diff --git a/test/test_chordpro/newline.crlf.csg.source b/test/test_chordpro/newline.crlf.csg.source new file mode 100644 index 00000000..2071e66d --- /dev/null +++ b/test/test_chordpro/newline.crlf.csg.source @@ -0,0 +1,2 @@ +# This content will be overwritten with `newline.csg.source` content +# with windows line endings (CRLF) - for testing purposes diff --git a/test/test_chordpro/newline.crlf.source b/test/test_chordpro/newline.crlf.source deleted file mode 100644 index bd45d5ce..00000000 --- a/test/test_chordpro/newline.crlf.source +++ /dev/null @@ -1,2 +0,0 @@ -# This content will be overwritten with `newline.source` content -# with windows line endings (CRLF) - for testing purposes diff --git a/test/test_chordpro/newline.crlf.tex b/test/test_chordpro/newline.crlf.tsg similarity index 100% rename from test/test_chordpro/newline.crlf.tex rename to test/test_chordpro/newline.crlf.tsg diff --git a/test/test_chordpro/newline.sgc b/test/test_chordpro/newline.csg similarity index 100% rename from test/test_chordpro/newline.sgc rename to test/test_chordpro/newline.csg diff --git a/test/test_chordpro/newline.source b/test/test_chordpro/newline.csg.source similarity index 100% rename from test/test_chordpro/newline.source rename to test/test_chordpro/newline.csg.source diff --git a/test/test_chordpro/newline.tex b/test/test_chordpro/newline.tsg similarity index 100% rename from test/test_chordpro/newline.tex rename to test/test_chordpro/newline.tsg diff --git a/test/test_chordpro/nolyrics.sgc b/test/test_chordpro/nolyrics.csg similarity index 100% rename from test/test_chordpro/nolyrics.sgc rename to test/test_chordpro/nolyrics.csg diff --git a/test/test_chordpro/nolyrics.source b/test/test_chordpro/nolyrics.csg.source similarity index 100% rename from test/test_chordpro/nolyrics.source rename to test/test_chordpro/nolyrics.csg.source diff --git a/test/test_chordpro/nolyrics.tex b/test/test_chordpro/nolyrics.tsg similarity index 100% rename from test/test_chordpro/nolyrics.tex rename to test/test_chordpro/nolyrics.tsg diff --git a/test/test_chordpro/tags.sgc b/test/test_chordpro/tags.csg similarity index 100% rename from test/test_chordpro/tags.sgc rename to test/test_chordpro/tags.csg diff --git a/test/test_chordpro/tags.source b/test/test_chordpro/tags.csg.source similarity index 100% rename from test/test_chordpro/tags.source rename to test/test_chordpro/tags.csg.source diff --git a/test/test_chordpro/tags.tex b/test/test_chordpro/tags.tsg similarity index 100% rename from test/test_chordpro/tags.tex rename to test/test_chordpro/tags.tsg diff --git a/test/test_chordpro/test_parser.py b/test/test_chordpro/test_parser.py index 5d8a64da..9ebe3e00 100644 --- a/test/test_chordpro/test_parser.py +++ b/test/test_chordpro/test_parser.py @@ -15,17 +15,13 @@ from patacrep.encoding import open_read from .. import disable_logging from .. import dynamic # pylint: disable=unused-import -LANGUAGES = { - 'tex': 'latex', - 'sgc': 'chordpro', - 'html': 'html', -} +OUTPUTS = ['csg', 'tsg', 'html'] class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): """Test of chorpro parser, and several renderers. For any given `foo.source`, it is parsed as a chordpro file, and should be - rendered as `foo.sgc` with the chordpro renderer, and `foo.tex` with the + rendered as `foo.csg` with the chordpro renderer, and `foo.tsg` with the latex renderer. This class does nothing by itself, but its metaclass populates it with test @@ -50,15 +46,15 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): with files.chdir(resource_filename(__name__, ""), *path): yield - def assertRender(self, base, destformat): # pylint: disable=invalid-name - """Assert that `{base}.source` is correctly rendered in the `destformat`. + def assertRender(self, base, in_format, out_format): # pylint: disable=invalid-name + """Assert that `{base}.source` is correctly rendered in the `out_format`. """ - sourcename = "{}.source".format(base) - destname = "{}.{}".format(base, destformat) + sourcename = "{}.{}.source".format(base, in_format) + destname = "{}.{}".format(base, out_format) with self.chdir(): with open_read(destname) as expectfile: with disable_logging(): - song = self.song_plugins[LANGUAGES[destformat]]['sgc'](sourcename, self.config) + song = self.song_plugins[out_format][in_format](sourcename, self.config) self.assertMultiLineEqual( song.render().strip(), expectfile.read().strip(), @@ -79,45 +75,47 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): keyword='SONG_RENDERERS', ) with cls.chdir(): - for source in sorted(glob.glob('*.source')): - base = source[:-len(".source")] - for dest in LANGUAGES: - destname = "{}.{}".format(base, dest) - if not os.path.exists(destname): + for source in sorted(glob.glob('*.*.source')): + [*base, in_format, _] = source.split('.') + base = '.'.join(base) + for out_format in OUTPUTS: + outname = "{}.{}".format(base, out_format) + if not os.path.exists(outname): continue yield ( - "test_{}_{}".format(base, dest), - cls._create_test(base, dest), + "test_{}_{}_2_{}".format(base, in_format, out_format), + cls._create_test(base, in_format, out_format), ) with cls.chdir('errors'): - for source in sorted(glob.glob('*.source')): - base = source[:-len(".source")] + for source in sorted(glob.glob('*.*.source')): + [*base, in_format, _] = source.split('.') + base = '.'.join(base) yield ( - "test_{}_failure".format(base), - cls._create_failure(base), + "test_{}_{}_failure".format(base, in_format), + cls._create_failure(base, in_format), ) @classmethod - def _create_test(cls, base, dest): - """Return a function testing that `base` compilation in `dest` format. + def _create_test(cls, base, in_format, out_format): + """Return a function testing that `base` compilation in `out_format` format. """ - test_parse_render = lambda self: self.assertRender(base, dest) + test_parse_render = lambda self: self.assertRender(base, in_format, out_format) test_parse_render.__doc__ = ( - "Test that '{base}' is correctly parsed and rendererd into '{format}' format." - ).format(base=os.path.basename(base), format=dest) + "Test that '{base}.{in_format}' is correctly parsed and rendererd into '{out_format}'." + ).format(base=os.path.basename(base), in_format=in_format, out_format=out_format) return test_parse_render @classmethod - def _create_failure(cls, base): + def _create_failure(cls, base, in_format, out_format='tsg'): """Return a function testing that `base` parsing fails. """ def test_parse_failure(self): """Test that `base` parsing fails.""" - sourcename = "{}.source".format(base) + sourcename = "{}.{}.source".format(base, in_format) with self.chdir('errors'): - parser = self.song_plugins[LANGUAGES['sgc']]['sgc'] + parser = self.song_plugins[out_format][in_format] self.assertRaises(SyntaxError, parser, sourcename, self.config) test_parse_failure.__doc__ = ( @@ -130,9 +128,9 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): """Overwrite `*.crlf.source` files to force the CRLF line endings. """ with cls.chdir(): - for crlfname in sorted(glob.glob('*.crlf.source')): - base = crlfname[:-len(".crlf.source")] - sourcename = base + ".source" + for crlfname in sorted(glob.glob('*.crlf.*.source')): + [*base, _, in_format, source] = crlfname.split('.') + sourcename = '.'.join(base + [in_format, source]) with open_read(sourcename) as sourcefile: with open(crlfname, 'w') as crlffile: for line in sourcefile: @@ -146,7 +144,8 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): # with windows line endings (CRLF) - for testing purposes """ with cls.chdir(): - for crlfname in sorted(glob.glob('*.crlf.source')): - base = crlfname[:-len(".crlf.source")] + for crlfname in sorted(glob.glob('*.crlf.*.source')): + [*base, crlf, in_format, _] = crlfname.split('.') + base = '.'.join(base + [in_format]) with open(crlfname, 'w') as crlffile: crlffile.write(crlf_msg.format(base)) diff --git a/test/test_chordpro/ukulelechords.sgc b/test/test_chordpro/ukulelechords.csg similarity index 100% rename from test/test_chordpro/ukulelechords.sgc rename to test/test_chordpro/ukulelechords.csg diff --git a/test/test_chordpro/ukulelechords.source b/test/test_chordpro/ukulelechords.csg.source similarity index 100% rename from test/test_chordpro/ukulelechords.source rename to test/test_chordpro/ukulelechords.csg.source diff --git a/test/test_chordpro/ukulelechords.tex b/test/test_chordpro/ukulelechords.tsg similarity index 100% rename from test/test_chordpro/ukulelechords.tex rename to test/test_chordpro/ukulelechords.tsg