plint

French poetry validator (local mirror of https://gitlab.com/a3nm/plint)
git clone https://a3nm.net/git/plint/
Log | Files | Refs | README

commit feed537f31169cea5f9c79556fe0c3ee91f19e99
parent af3cc35b105672b1f508af7b38387b8b1d8109c6
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sun, 11 Aug 2019 00:06:06 +0200

tests for hiatus

Diffstat:
versetest.py | 31+++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+), 0 deletions(-)

diff --git a/versetest.py b/versetest.py @@ -79,6 +79,37 @@ class BadChars(unittest.TestCase): return True return False +class Hiatus(unittest.TestCase): + def testBadVowel(self): + v = verse.Verse("patati patata patata arbrisseau", template.Template(), template.Pattern("12")) + v.parse() + self.assertFalse(v.valid()) + + def testBadUnaspirated(self): + v = verse.Verse("patati patata patata hirondelle", template.Template(), template.Pattern("12")) + v.parse() + self.assertFalse(v.valid()) + + def testGoodAspirated(self): + v = verse.Verse("patati patata patata tata hache", template.Template(), template.Pattern("12")) + v.parse() + self.assertTrue(v.valid()) + + def testGoodConsonant(self): + v = verse.Verse("patati patata patatah arbrisseau", template.Template(), template.Pattern("12")) + v.parse() + self.assertTrue(v.valid()) + + def testGoodMuteE(self): + v = verse.Verse("patati patata patatue arbrisseau", template.Template(), template.Pattern("12")) + v.parse() + self.assertTrue(v.valid()) + + def testBadEt(self): + v = verse.Verse("patati patata patata et avant", template.Template(), template.Pattern("12")) + v.parse() + self.assertFalse(v.valid()) + class Counts(unittest.TestCase): def runCount(self, text, limit=12, hemistiches=None): v = verse.Verse(text, template.Template(), template.Pattern(str(limit),