From 96697be9d1a990bab9e36a9ba53751223701d8fd Mon Sep 17 00:00:00 2001 From: Louis Date: Sat, 29 Aug 2015 11:49:56 +0200 Subject: [PATCH] [chorpro][test] Simplifying parsing and compilation tests: preparation for LaTeX tests --- patacrep/songs/chordpro/data/chordpro/song | 3 +- .../chordpro/test/{00.txt => 00.sgc.sgc} | 0 .../chordpro/test/{00.sgc => 00.sgc.source} | 0 .../chordpro/test/{01.txt => 01.sgc.sgc} | 0 .../chordpro/test/{01.sgc => 01.sgc.source} | 0 .../chordpro/test/{02.txt => 02.sgc.sgc} | 0 .../chordpro/test/{02.sgc => 02.sgc.source} | 0 .../chordpro/test/{03.txt => 03.sgc.sgc} | 0 .../chordpro/test/{03.sgc => 03.sgc.source} | 0 .../chordpro/test/{04.txt => 04.sgc.sgc} | 0 .../chordpro/test/{04.sgc => 04.sgc.source} | 0 .../chordpro/test/{05.txt => 05.sgc.sgc} | 0 .../chordpro/test/{05.sgc => 05.sgc.source} | 0 .../chordpro/test/{06.txt => 06.sgc.sgc} | 0 .../chordpro/test/{06.sgc => 06.sgc.source} | 0 .../chordpro/test/{07.txt => 07.sgc.sgc} | 0 .../chordpro/test/{07.sgc => 07.sgc.source} | 0 .../chordpro/test/{08.txt => 08.sgc.sgc} | 0 .../chordpro/test/{08.sgc => 08.sgc.source} | 0 .../chordpro/test/{09.txt => 09.sgc.sgc} | 0 .../chordpro/test/{09.sgc => 09.sgc.source} | 0 .../chordpro/test/{10.txt => 10.sgc.sgc} | 0 .../chordpro/test/{10.sgc => 10.sgc.source} | 0 .../chordpro/test/{11.txt => 11.sgc.sgc} | 0 .../chordpro/test/{11.sgc => 11.sgc.source} | 0 .../chordpro/test/{12.txt => 12.sgc.sgc} | 0 .../chordpro/test/{12.sgc => 12.sgc.source} | 0 .../chordpro/test/{13.txt => 13.sgc.sgc} | 0 .../chordpro/test/{13.sgc => 13.sgc.source} | 0 .../chordpro/test/{21.txt => 21.sgc.sgc} | 0 .../chordpro/test/{21.sgc => 21.sgc.source} | 0 .../chordpro/test/{22.txt => 22.sgc.sgc} | 0 .../chordpro/test/{22.sgc => 22.sgc.source} | 0 .../chordpro/test/{23.txt => 23.sgc.sgc} | 0 .../chordpro/test/{23.sgc => 23.sgc.source} | 0 .../chordpro/test/{24.txt => 24.sgc.sgc} | 0 .../chordpro/test/{24.sgc => 24.sgc.source} | 0 .../chordpro/test/{25.txt => 25.sgc.sgc} | 0 .../chordpro/test/{25.sgc => 25.sgc.source} | 0 .../chordpro/test/{26.txt => 26.sgc.sgc} | 0 .../chordpro/test/{26.sgc => 26.sgc.source} | 0 .../chordpro/test/{27.txt => 27.sgc.sgc} | 0 .../chordpro/test/{27.sgc => 27.sgc.source} | 0 .../chordpro/test/{28.txt => 28.sgc.sgc} | 0 .../chordpro/test/{28.sgc => 28.sgc.source} | 0 .../chordpro/test/{29.txt => 29.sgc.sgc} | 0 .../chordpro/test/{29.sgc => 29.sgc.source} | 0 patacrep/songs/chordpro/test/30.sgc | 1 - .../test/{chords.txt => chords.sgc.sgc} | 0 .../test/{chords.sgc => chords.sgc.source} | 0 ...{customchords.txt => customchords.sgc.sgc} | 0 ...stomchords.sgc => customchords.sgc.source} | 0 ...{greensleeves.txt => greensleeves.sgc.sgc} | 0 ...eensleeves.sgc => greensleeves.sgc.source} | 0 ...nvalid_chord.txt => invalid_chord.sgc.sgc} | 0 ...lid_chord.sgc => invalid_chord.sgc.source} | 0 ...mchord.txt => invalid_customchord.sgc.sgc} | 0 ...ord.sgc => invalid_customchord.sgc.source} | 0 .../test/{metadata.txt => metadata.sgc.sgc} | 0 .../{metadata.sgc => metadata.sgc.source} | 0 patacrep/songs/chordpro/test/test_parser.py | 60 +++++++------------ 61 files changed, 24 insertions(+), 40 deletions(-) rename patacrep/songs/chordpro/test/{00.txt => 00.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{00.sgc => 00.sgc.source} (100%) rename patacrep/songs/chordpro/test/{01.txt => 01.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{01.sgc => 01.sgc.source} (100%) rename patacrep/songs/chordpro/test/{02.txt => 02.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{02.sgc => 02.sgc.source} (100%) rename patacrep/songs/chordpro/test/{03.txt => 03.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{03.sgc => 03.sgc.source} (100%) rename patacrep/songs/chordpro/test/{04.txt => 04.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{04.sgc => 04.sgc.source} (100%) rename patacrep/songs/chordpro/test/{05.txt => 05.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{05.sgc => 05.sgc.source} (100%) rename patacrep/songs/chordpro/test/{06.txt => 06.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{06.sgc => 06.sgc.source} (100%) rename patacrep/songs/chordpro/test/{07.txt => 07.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{07.sgc => 07.sgc.source} (100%) rename patacrep/songs/chordpro/test/{08.txt => 08.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{08.sgc => 08.sgc.source} (100%) rename patacrep/songs/chordpro/test/{09.txt => 09.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{09.sgc => 09.sgc.source} (100%) rename patacrep/songs/chordpro/test/{10.txt => 10.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{10.sgc => 10.sgc.source} (100%) rename patacrep/songs/chordpro/test/{11.txt => 11.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{11.sgc => 11.sgc.source} (100%) rename patacrep/songs/chordpro/test/{12.txt => 12.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{12.sgc => 12.sgc.source} (100%) rename patacrep/songs/chordpro/test/{13.txt => 13.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{13.sgc => 13.sgc.source} (100%) rename patacrep/songs/chordpro/test/{21.txt => 21.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{21.sgc => 21.sgc.source} (100%) rename patacrep/songs/chordpro/test/{22.txt => 22.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{22.sgc => 22.sgc.source} (100%) rename patacrep/songs/chordpro/test/{23.txt => 23.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{23.sgc => 23.sgc.source} (100%) rename patacrep/songs/chordpro/test/{24.txt => 24.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{24.sgc => 24.sgc.source} (100%) rename patacrep/songs/chordpro/test/{25.txt => 25.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{25.sgc => 25.sgc.source} (100%) rename patacrep/songs/chordpro/test/{26.txt => 26.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{26.sgc => 26.sgc.source} (100%) rename patacrep/songs/chordpro/test/{27.txt => 27.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{27.sgc => 27.sgc.source} (100%) rename patacrep/songs/chordpro/test/{28.txt => 28.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{28.sgc => 28.sgc.source} (100%) rename patacrep/songs/chordpro/test/{29.txt => 29.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{29.sgc => 29.sgc.source} (100%) delete mode 100644 patacrep/songs/chordpro/test/30.sgc rename patacrep/songs/chordpro/test/{chords.txt => chords.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{chords.sgc => chords.sgc.source} (100%) rename patacrep/songs/chordpro/test/{customchords.txt => customchords.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{customchords.sgc => customchords.sgc.source} (100%) rename patacrep/songs/chordpro/test/{greensleeves.txt => greensleeves.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{greensleeves.sgc => greensleeves.sgc.source} (100%) rename patacrep/songs/chordpro/test/{invalid_chord.txt => invalid_chord.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{invalid_chord.sgc => invalid_chord.sgc.source} (100%) rename patacrep/songs/chordpro/test/{invalid_customchord.txt => invalid_customchord.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{invalid_customchord.sgc => invalid_customchord.sgc.source} (100%) rename patacrep/songs/chordpro/test/{metadata.txt => metadata.sgc.sgc} (100%) rename patacrep/songs/chordpro/test/{metadata.sgc => metadata.sgc.source} (100%) diff --git a/patacrep/songs/chordpro/data/chordpro/song b/patacrep/songs/chordpro/data/chordpro/song index 95a5e492..30bf9a3e 100644 --- a/patacrep/songs/chordpro/data/chordpro/song +++ b/patacrep/songs/chordpro/data/chordpro/song @@ -11,7 +11,8 @@ (*- for title in titles -*) {title: (( title ))} (* endfor -*) -(* for author in authors -*) + +(*- for author in authors -*) {artist: (( author[1] )) (( author[0] ))} (* endfor *) diff --git a/patacrep/songs/chordpro/test/00.txt b/patacrep/songs/chordpro/test/00.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/00.txt rename to patacrep/songs/chordpro/test/00.sgc.sgc diff --git a/patacrep/songs/chordpro/test/00.sgc b/patacrep/songs/chordpro/test/00.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/00.sgc rename to patacrep/songs/chordpro/test/00.sgc.source diff --git a/patacrep/songs/chordpro/test/01.txt b/patacrep/songs/chordpro/test/01.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/01.txt rename to patacrep/songs/chordpro/test/01.sgc.sgc diff --git a/patacrep/songs/chordpro/test/01.sgc b/patacrep/songs/chordpro/test/01.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/01.sgc rename to patacrep/songs/chordpro/test/01.sgc.source diff --git a/patacrep/songs/chordpro/test/02.txt b/patacrep/songs/chordpro/test/02.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/02.txt rename to patacrep/songs/chordpro/test/02.sgc.sgc diff --git a/patacrep/songs/chordpro/test/02.sgc b/patacrep/songs/chordpro/test/02.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/02.sgc rename to patacrep/songs/chordpro/test/02.sgc.source diff --git a/patacrep/songs/chordpro/test/03.txt b/patacrep/songs/chordpro/test/03.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/03.txt rename to patacrep/songs/chordpro/test/03.sgc.sgc diff --git a/patacrep/songs/chordpro/test/03.sgc b/patacrep/songs/chordpro/test/03.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/03.sgc rename to patacrep/songs/chordpro/test/03.sgc.source diff --git a/patacrep/songs/chordpro/test/04.txt b/patacrep/songs/chordpro/test/04.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/04.txt rename to patacrep/songs/chordpro/test/04.sgc.sgc diff --git a/patacrep/songs/chordpro/test/04.sgc b/patacrep/songs/chordpro/test/04.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/04.sgc rename to patacrep/songs/chordpro/test/04.sgc.source diff --git a/patacrep/songs/chordpro/test/05.txt b/patacrep/songs/chordpro/test/05.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/05.txt rename to patacrep/songs/chordpro/test/05.sgc.sgc diff --git a/patacrep/songs/chordpro/test/05.sgc b/patacrep/songs/chordpro/test/05.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/05.sgc rename to patacrep/songs/chordpro/test/05.sgc.source diff --git a/patacrep/songs/chordpro/test/06.txt b/patacrep/songs/chordpro/test/06.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/06.txt rename to patacrep/songs/chordpro/test/06.sgc.sgc diff --git a/patacrep/songs/chordpro/test/06.sgc b/patacrep/songs/chordpro/test/06.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/06.sgc rename to patacrep/songs/chordpro/test/06.sgc.source diff --git a/patacrep/songs/chordpro/test/07.txt b/patacrep/songs/chordpro/test/07.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/07.txt rename to patacrep/songs/chordpro/test/07.sgc.sgc diff --git a/patacrep/songs/chordpro/test/07.sgc b/patacrep/songs/chordpro/test/07.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/07.sgc rename to patacrep/songs/chordpro/test/07.sgc.source diff --git a/patacrep/songs/chordpro/test/08.txt b/patacrep/songs/chordpro/test/08.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/08.txt rename to patacrep/songs/chordpro/test/08.sgc.sgc diff --git a/patacrep/songs/chordpro/test/08.sgc b/patacrep/songs/chordpro/test/08.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/08.sgc rename to patacrep/songs/chordpro/test/08.sgc.source diff --git a/patacrep/songs/chordpro/test/09.txt b/patacrep/songs/chordpro/test/09.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/09.txt rename to patacrep/songs/chordpro/test/09.sgc.sgc diff --git a/patacrep/songs/chordpro/test/09.sgc b/patacrep/songs/chordpro/test/09.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/09.sgc rename to patacrep/songs/chordpro/test/09.sgc.source diff --git a/patacrep/songs/chordpro/test/10.txt b/patacrep/songs/chordpro/test/10.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/10.txt rename to patacrep/songs/chordpro/test/10.sgc.sgc diff --git a/patacrep/songs/chordpro/test/10.sgc b/patacrep/songs/chordpro/test/10.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/10.sgc rename to patacrep/songs/chordpro/test/10.sgc.source diff --git a/patacrep/songs/chordpro/test/11.txt b/patacrep/songs/chordpro/test/11.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/11.txt rename to patacrep/songs/chordpro/test/11.sgc.sgc diff --git a/patacrep/songs/chordpro/test/11.sgc b/patacrep/songs/chordpro/test/11.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/11.sgc rename to patacrep/songs/chordpro/test/11.sgc.source diff --git a/patacrep/songs/chordpro/test/12.txt b/patacrep/songs/chordpro/test/12.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/12.txt rename to patacrep/songs/chordpro/test/12.sgc.sgc diff --git a/patacrep/songs/chordpro/test/12.sgc b/patacrep/songs/chordpro/test/12.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/12.sgc rename to patacrep/songs/chordpro/test/12.sgc.source diff --git a/patacrep/songs/chordpro/test/13.txt b/patacrep/songs/chordpro/test/13.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/13.txt rename to patacrep/songs/chordpro/test/13.sgc.sgc diff --git a/patacrep/songs/chordpro/test/13.sgc b/patacrep/songs/chordpro/test/13.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/13.sgc rename to patacrep/songs/chordpro/test/13.sgc.source diff --git a/patacrep/songs/chordpro/test/21.txt b/patacrep/songs/chordpro/test/21.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/21.txt rename to patacrep/songs/chordpro/test/21.sgc.sgc diff --git a/patacrep/songs/chordpro/test/21.sgc b/patacrep/songs/chordpro/test/21.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/21.sgc rename to patacrep/songs/chordpro/test/21.sgc.source diff --git a/patacrep/songs/chordpro/test/22.txt b/patacrep/songs/chordpro/test/22.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/22.txt rename to patacrep/songs/chordpro/test/22.sgc.sgc diff --git a/patacrep/songs/chordpro/test/22.sgc b/patacrep/songs/chordpro/test/22.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/22.sgc rename to patacrep/songs/chordpro/test/22.sgc.source diff --git a/patacrep/songs/chordpro/test/23.txt b/patacrep/songs/chordpro/test/23.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/23.txt rename to patacrep/songs/chordpro/test/23.sgc.sgc diff --git a/patacrep/songs/chordpro/test/23.sgc b/patacrep/songs/chordpro/test/23.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/23.sgc rename to patacrep/songs/chordpro/test/23.sgc.source diff --git a/patacrep/songs/chordpro/test/24.txt b/patacrep/songs/chordpro/test/24.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/24.txt rename to patacrep/songs/chordpro/test/24.sgc.sgc diff --git a/patacrep/songs/chordpro/test/24.sgc b/patacrep/songs/chordpro/test/24.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/24.sgc rename to patacrep/songs/chordpro/test/24.sgc.source diff --git a/patacrep/songs/chordpro/test/25.txt b/patacrep/songs/chordpro/test/25.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/25.txt rename to patacrep/songs/chordpro/test/25.sgc.sgc diff --git a/patacrep/songs/chordpro/test/25.sgc b/patacrep/songs/chordpro/test/25.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/25.sgc rename to patacrep/songs/chordpro/test/25.sgc.source diff --git a/patacrep/songs/chordpro/test/26.txt b/patacrep/songs/chordpro/test/26.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/26.txt rename to patacrep/songs/chordpro/test/26.sgc.sgc diff --git a/patacrep/songs/chordpro/test/26.sgc b/patacrep/songs/chordpro/test/26.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/26.sgc rename to patacrep/songs/chordpro/test/26.sgc.source diff --git a/patacrep/songs/chordpro/test/27.txt b/patacrep/songs/chordpro/test/27.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/27.txt rename to patacrep/songs/chordpro/test/27.sgc.sgc diff --git a/patacrep/songs/chordpro/test/27.sgc b/patacrep/songs/chordpro/test/27.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/27.sgc rename to patacrep/songs/chordpro/test/27.sgc.source diff --git a/patacrep/songs/chordpro/test/28.txt b/patacrep/songs/chordpro/test/28.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/28.txt rename to patacrep/songs/chordpro/test/28.sgc.sgc diff --git a/patacrep/songs/chordpro/test/28.sgc b/patacrep/songs/chordpro/test/28.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/28.sgc rename to patacrep/songs/chordpro/test/28.sgc.source diff --git a/patacrep/songs/chordpro/test/29.txt b/patacrep/songs/chordpro/test/29.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/29.txt rename to patacrep/songs/chordpro/test/29.sgc.sgc diff --git a/patacrep/songs/chordpro/test/29.sgc b/patacrep/songs/chordpro/test/29.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/29.sgc rename to patacrep/songs/chordpro/test/29.sgc.source diff --git a/patacrep/songs/chordpro/test/30.sgc b/patacrep/songs/chordpro/test/30.sgc deleted file mode 100644 index ee67061c..00000000 --- a/patacrep/songs/chordpro/test/30.sgc +++ /dev/null @@ -1 +0,0 @@ - [A]A line starting with a chord diff --git a/patacrep/songs/chordpro/test/chords.txt b/patacrep/songs/chordpro/test/chords.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/chords.txt rename to patacrep/songs/chordpro/test/chords.sgc.sgc diff --git a/patacrep/songs/chordpro/test/chords.sgc b/patacrep/songs/chordpro/test/chords.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/chords.sgc rename to patacrep/songs/chordpro/test/chords.sgc.source diff --git a/patacrep/songs/chordpro/test/customchords.txt b/patacrep/songs/chordpro/test/customchords.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/customchords.txt rename to patacrep/songs/chordpro/test/customchords.sgc.sgc diff --git a/patacrep/songs/chordpro/test/customchords.sgc b/patacrep/songs/chordpro/test/customchords.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/customchords.sgc rename to patacrep/songs/chordpro/test/customchords.sgc.source diff --git a/patacrep/songs/chordpro/test/greensleeves.txt b/patacrep/songs/chordpro/test/greensleeves.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/greensleeves.txt rename to patacrep/songs/chordpro/test/greensleeves.sgc.sgc diff --git a/patacrep/songs/chordpro/test/greensleeves.sgc b/patacrep/songs/chordpro/test/greensleeves.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/greensleeves.sgc rename to patacrep/songs/chordpro/test/greensleeves.sgc.source diff --git a/patacrep/songs/chordpro/test/invalid_chord.txt b/patacrep/songs/chordpro/test/invalid_chord.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/invalid_chord.txt rename to patacrep/songs/chordpro/test/invalid_chord.sgc.sgc diff --git a/patacrep/songs/chordpro/test/invalid_chord.sgc b/patacrep/songs/chordpro/test/invalid_chord.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/invalid_chord.sgc rename to patacrep/songs/chordpro/test/invalid_chord.sgc.source diff --git a/patacrep/songs/chordpro/test/invalid_customchord.txt b/patacrep/songs/chordpro/test/invalid_customchord.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/invalid_customchord.txt rename to patacrep/songs/chordpro/test/invalid_customchord.sgc.sgc diff --git a/patacrep/songs/chordpro/test/invalid_customchord.sgc b/patacrep/songs/chordpro/test/invalid_customchord.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/invalid_customchord.sgc rename to patacrep/songs/chordpro/test/invalid_customchord.sgc.source diff --git a/patacrep/songs/chordpro/test/metadata.txt b/patacrep/songs/chordpro/test/metadata.sgc.sgc similarity index 100% rename from patacrep/songs/chordpro/test/metadata.txt rename to patacrep/songs/chordpro/test/metadata.sgc.sgc diff --git a/patacrep/songs/chordpro/test/metadata.sgc b/patacrep/songs/chordpro/test/metadata.sgc.source similarity index 100% rename from patacrep/songs/chordpro/test/metadata.sgc rename to patacrep/songs/chordpro/test/metadata.sgc.source diff --git a/patacrep/songs/chordpro/test/test_parser.py b/patacrep/songs/chordpro/test/test_parser.py index 2fc89ca6..669610a9 100644 --- a/patacrep/songs/chordpro/test/test_parser.py +++ b/patacrep/songs/chordpro/test/test_parser.py @@ -11,49 +11,33 @@ from patacrep.songs.chordpro import ChordproSong from patacrep.test import disable_logging -class ParserTxtRenderer(unittest.TestCase): - """Test parser, and renderer as a txt file.""" +class TestParsingRendering(unittest.TestCase): + """Test parsing and rendering""" maxDiff = None - def __init__(self, methodname="runTest", basename=None): - super().__init__(methodname) - self.basename = basename - - def shortDescription(self): - return "Parsing file '{}.txt'.".format(self.basename) - - def runTest(self): - """Test txt output (default, debug output).""" - # pylint: disable=invalid-name - - if self.basename is None: - return + def test_all(self): config = DEFAULT_CONFIG.copy() config.update({ 'encoding': 'utf8', '_compiled_authwords': {}, }) - with open("{}.txt".format(self.basename), 'r', encoding='utf8') as expectfile: - chordproname = "{}.sgc".format(self.basename) - with disable_logging(): - self.assertMultiLineEqual( - ChordproSong(None, chordproname, config).render( - output=chordproname, - output_format="chordpro", - ).strip(), - expectfile.read().replace( - "DIRNAME", - os.path.dirname(self.basename), - ).strip(), - ) - -def load_tests(__loader, tests, __pattern): - """Load several tests given test files present in the directory.""" - # Load all txt files as tests - for txt in sorted(glob.glob(os.path.join( - os.path.dirname(__file__), - '*.txt', - ))): - tests.addTest(ParserTxtRenderer(basename=txt[:-len('.txt')])) - return tests + for source in sorted(glob.glob(os.path.join( + os.path.dirname(__file__), + '*.source', + ))): + base = source[:-len(".source")] + with open("{}.sgc".format(base), 'r', encoding='utf8') as expectfile: + chordproname = "{}.source".format(base) + with disable_logging(): + with self.subTest(base=os.path.basename(base)): + self.assertMultiLineEqual( + ChordproSong(None, chordproname, config).render( + output=chordproname, + output_format="chordpro", + ).strip(), + expectfile.read().replace( + "DIRNAME", + os.path.dirname(base), + ).strip(), + )