Skip to content
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