tests/misc.py

changeset 94
109fb7cf658f
parent 88
6a0b43a5dec0
child 105
43c367c8895b
equal deleted inserted replaced
93:ffe05d369412 94:109fb7cf658f
227 yield report_problem('unknown-metacommand', 227 yield report_problem('unknown-metacommand',
228 bad_object = element, 228 bad_object = element,
229 command_text = element.text, 229 command_text = element.text,
230 ) 230 )
231 231
232 @problem_type('bad-line-endings',
233 severity = 'hold',
234 message = lambda count: str.format(
235 'file contains non-DOS line endings ({count} total)',
236 count = count,
237 ),
238 )
239 def line_endings_test(model):
240 # Line endings are already checked during parse. This function
241 # only serves to report them.
242 if model.line_ending_errors != None:
243 yield report_problem(
244 'bad-line-endings',
245 bad_object = model.body[model.line_ending_errors['first-at']],
246 count = model.line_ending_errors['count'],
247 )
248
232 manifest = { 249 manifest = {
233 'tests': [ 250 'tests': [
234 colours_test, 251 colours_test,
235 syntax_errors, 252 syntax_errors,
236 bad_header, 253 bad_header,
241 keywords_tests, 258 keywords_tests,
242 colour_24_test, 259 colour_24_test,
243 moved_to_with_extension_test, 260 moved_to_with_extension_test,
244 bfc_invertnext_not_on_subfile_test, 261 bfc_invertnext_not_on_subfile_test,
245 metacommands_test, 262 metacommands_test,
263 line_endings_test,
246 ], 264 ],
247 } 265 }

mercurial