mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Check for errors in tidy config file
This commit is contained in:
parent
0ad905ae42
commit
74dba5cbdd
3 changed files with 69 additions and 1 deletions
|
@ -23,6 +23,13 @@ class CheckTidiness(unittest.TestCase):
|
|||
with self.assertRaises(StopIteration):
|
||||
errors.next()
|
||||
|
||||
def test_tidy_config(self):
|
||||
errors = tidy.check_config_file(os.path.join(base_path, 'servo-tidy.toml'))
|
||||
self.assertEqual('invalid config key \'key-outside\'', errors.next()[2])
|
||||
self.assertEqual('invalid config key \'wrong-key\'', errors.next()[2])
|
||||
self.assertEqual('invalid config table [wrong]', errors.next()[2])
|
||||
self.assertNoMoreErrors(errors)
|
||||
|
||||
def test_spaces_correctnes(self):
|
||||
errors = tidy.collect_errors_for_files(iterFile('wrong_space.rs'), [], [tidy.check_by_line], print_text=False)
|
||||
self.assertEqual('trailing whitespace', errors.next()[2])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue