From 5633c05e2f9c73679b7898bf0e41f07eb522d709 Mon Sep 17 00:00:00 2001 From: Sunshine Date: Tue, 27 Oct 2020 23:37:14 -1000 Subject: [PATCH] add test for minuses within song texts --- tests/database-tests.d/3-song-texts.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/database-tests.d/3-song-texts.py b/tests/database-tests.d/3-song-texts.py index 7f8bdac96..84d6630c0 100644 --- a/tests/database-tests.d/3-song-texts.py +++ b/tests/database-tests.d/3-song-texts.py @@ -21,6 +21,11 @@ def testForProperEllipses(path, bytes, contents, text, metadata): return CODE_WARN return CODE_OK +def testForNoMinuses(path, bytes, contents, text, metadata): + if '-' in text: + return CODE_WARN + return CODE_OK + def testTheTests(*_): def testTheTestForNoSpacesAroundLines(): passing = testForNoSpacesAroundLines('', b'', '', 'La la la\nLa la\nLa\n', {}) == CODE_OK @@ -34,8 +39,13 @@ def testTheTestForProperEllipses(): passing = testForProperEllipses('', b'', '', 'La la la\nLa la\nLa…\n', {}) == CODE_OK failing = testForProperEllipses('', b'', '', 'She said..\n', {}) == CODE_WARN return passing and failing + def testTheTestForNoMinuses(): + passing = testForNoMinuses('', b'', '', 'La la la…\n', {}) == CODE_OK + failing = testForNoMinuses('', b'', '', 'She said - he said\n', {}) == CODE_WARN + return passing and failing if not testTheTestForNoSpacesAroundLines() \ or not testTheTestForSmartQuotes() \ - or not testTheTestForProperEllipses(): + or not testTheTestForProperEllipses() \ + or not testTheTestForNoMinuses(): return CODE_ERR return CODE_OK