aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy_tests/test_tidy.py
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-04-22 21:46:30 -0700
committerbors-servo <lbergstrom+bors@mozilla.com>2016-04-22 21:46:30 -0700
commit04f8ae56db0ba9df798b39a5b2f1bb1e23d6dcf3 (patch)
tree31045ce0f1e21740faa8853e05b7f57be63cb94a /python/tidy/servo_tidy_tests/test_tidy.py
parentabce9de2337d4d41ba977241b268f5774975f7b0 (diff)
parentb6b8ac6cd394a0ac6182c4c7aa5c500e10a6f214 (diff)
downloadservo-04f8ae56db0ba9df798b39a5b2f1bb1e23d6dcf3.tar.gz
servo-04f8ae56db0ba9df798b39a5b2f1bb1e23d6dcf3.zip
Auto merge of #10786 - zwn:tidy-modelines, r=Manishearth
tidy check for vim and emacs modelines See #10719. It skips *.webidl files for now since I am not sure where they come from and if they should be edited in tree or not. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10786) <!-- Reviewable:end -->
Diffstat (limited to 'python/tidy/servo_tidy_tests/test_tidy.py')
-rw-r--r--python/tidy/servo_tidy_tests/test_tidy.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py
index f61c7961195..e07f0d1bb55 100644
--- a/python/tidy/servo_tidy_tests/test_tidy.py
+++ b/python/tidy/servo_tidy_tests/test_tidy.py
@@ -89,6 +89,14 @@ class CheckTidiness(unittest.TestCase):
self.assertEqual('found asterisk instead of minimum version number', errors.next()[2])
self.assertNoMoreErrors(errors)
+ def test_modeline(self):
+ errors = tidy.collect_errors_for_files(iterFile('modeline.txt'), [], [tidy.check_modeline])
+ self.assertEqual('vi modeline present', errors.next()[2])
+ self.assertEqual('vi modeline present', errors.next()[2])
+ self.assertEqual('vi modeline present', errors.next()[2])
+ self.assertEqual('emacs file variables present', errors.next()[2])
+ self.assertEqual('emacs file variables present', errors.next()[2])
+
def do_tests():
suite = unittest.TestLoader().loadTestsFromTestCase(CheckTidiness)