Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for minuses within song texts #471

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tests/database-tests.d/3-song-texts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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