aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy_tests/test_tidy.py
diff options
context:
space:
mode:
authorUK992 <urbankrajnc92@gmail.com>2016-08-29 18:33:03 +0200
committerUK992 <urbankrajnc92@gmail.com>2016-08-29 18:33:03 +0200
commitd5b76c9f6d667ee660a8d5e2a2cec2935c9e65c2 (patch)
tree186134e5fa93ca1e2a1c49981861f917ec6df8e6 /python/tidy/servo_tidy_tests/test_tidy.py
parent9e726b4d83fc169c38f176b9958cfb1b66363e8f (diff)
downloadservo-d5b76c9f6d667ee660a8d5e2a2cec2935c9e65c2.tar.gz
servo-d5b76c9f6d667ee660a8d5e2a2cec2935c9e65c2.zip
Tidy: Handle empty files
Diffstat (limited to 'python/tidy/servo_tidy_tests/test_tidy.py')
-rw-r--r--python/tidy/servo_tidy_tests/test_tidy.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py
index 746783d1759..c35e4b533d1 100644
--- a/python/tidy/servo_tidy_tests/test_tidy.py
+++ b/python/tidy/servo_tidy_tests/test_tidy.py
@@ -39,6 +39,11 @@ class CheckTidiness(unittest.TestCase):
self.assertEqual('no newline at EOF', errors.next()[2])
self.assertNoMoreErrors(errors)
+ def test_empty_file(self):
+ errors = tidy.collect_errors_for_files(iterFile('empty_file.rs'), [], [tidy.check_by_line], print_text=False)
+ self.assertEqual('file is empty', errors.next()[2])
+ self.assertNoMoreErrors(errors)
+
def test_long_line(self):
errors = tidy.collect_errors_for_files(iterFile('long_line.rs'), [], [tidy.check_by_line], print_text=False)
self.assertEqual('Line is longer than 120 characters', errors.next()[2])