mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #12565 - simartin:issue_12564, r=Ms2ger
Issue #12564: Fix "./mach test-tidy --self-test". Fix https://github.com/servo/servo/issues/12564 - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #12564 - [X] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12565) <!-- Reviewable:end -->
This commit is contained in:
commit
2e3bc57e99
1 changed files with 4 additions and 3 deletions
|
@ -93,6 +93,7 @@ class CheckTidiness(unittest.TestCase):
|
||||||
def test_toml(self):
|
def test_toml(self):
|
||||||
errors = tidy.collect_errors_for_files(iterFile('test.toml'), [tidy.check_toml], [], print_text=False)
|
errors = tidy.collect_errors_for_files(iterFile('test.toml'), [tidy.check_toml], [], print_text=False)
|
||||||
self.assertEqual('found asterisk instead of minimum version number', errors.next()[2])
|
self.assertEqual('found asterisk instead of minimum version number', errors.next()[2])
|
||||||
|
self.assertEqual('.toml file should contain a valid license.', errors.next()[2])
|
||||||
self.assertNoMoreErrors(errors)
|
self.assertNoMoreErrors(errors)
|
||||||
|
|
||||||
def test_modeline(self):
|
def test_modeline(self):
|
||||||
|
@ -130,11 +131,11 @@ class CheckTidiness(unittest.TestCase):
|
||||||
file_list = tidy.get_file_list(base_path, only_changed_files=False,
|
file_list = tidy.get_file_list(base_path, only_changed_files=False,
|
||||||
exclude_dirs=[])
|
exclude_dirs=[])
|
||||||
lst = list(file_list)
|
lst = list(file_list)
|
||||||
self.assertEqual([os.path.join(base_path, 'whee', 'test.rs')], lst)
|
self.assertEqual([os.path.join(base_path, 'whee', 'test.rs'), os.path.join(base_path, 'whee', 'foo', 'bar.rs')], lst)
|
||||||
file_list = tidy.get_file_list(base_path, only_changed_files=False,
|
file_list = tidy.get_file_list(base_path, only_changed_files=False,
|
||||||
exclude_dirs=[os.path.join(base_path,'whee')])
|
exclude_dirs=[os.path.join(base_path, 'whee', 'foo')])
|
||||||
lst = list(file_list)
|
lst = list(file_list)
|
||||||
self.assertEqual([], lst)
|
self.assertEqual([os.path.join(base_path, 'whee', 'test.rs')], lst)
|
||||||
|
|
||||||
def do_tests():
|
def do_tests():
|
||||||
suite = unittest.TestLoader().loadTestsFromTestCase(CheckTidiness)
|
suite = unittest.TestLoader().loadTestsFromTestCase(CheckTidiness)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue