diff -r ffe05d369412 -r 109fb7cf658f tests/misc.py --- a/tests/misc.py Mon Jun 24 17:34:30 2019 +0300 +++ b/tests/misc.py Mon Jun 24 19:08:24 2019 +0300 @@ -229,6 +229,23 @@ command_text = element.text, ) +@problem_type('bad-line-endings', + severity = 'hold', + message = lambda count: str.format( + 'file contains non-DOS line endings ({count} total)', + count = count, + ), +) +def line_endings_test(model): + # Line endings are already checked during parse. This function + # only serves to report them. + if model.line_ending_errors != None: + yield report_problem( + 'bad-line-endings', + bad_object = model.body[model.line_ending_errors['first-at']], + count = model.line_ending_errors['count'], + ) + manifest = { 'tests': [ colours_test, @@ -243,5 +260,6 @@ moved_to_with_extension_test, bfc_invertnext_not_on_subfile_test, metacommands_test, + line_endings_test, ], }