aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy_tests/test_tidy.py
diff options
context:
space:
mode:
authoredunham <edunham@mozilla.com>2016-04-19 13:57:09 -0700
committerUK992 <urbankrajnc92@gmail.com>2016-08-12 13:32:09 +0200
commit48ace17b5419a9795a13bded286e113e79d56905 (patch)
treebc78a198ae1129c8c16979b868fba2b2634d0eb1 /python/tidy/servo_tidy_tests/test_tidy.py
parent1f4dd8765fe06784f052765f63f3e4869faf8164 (diff)
downloadservo-48ace17b5419a9795a13bded286e113e79d56905.tar.gz
servo-48ace17b5419a9795a13bded286e113e79d56905.zip
Improve tidy's license validation logic
fixes https://github.com/servo/servo/issues/10716 I took the lazy way out and hardcoded the size of block we examine for licenses. fixes https://github.com/servo/servo/issues/10719 Includes tests for new functionality.
Diffstat (limited to 'python/tidy/servo_tidy_tests/test_tidy.py')
-rw-r--r--python/tidy/servo_tidy_tests/test_tidy.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py
index 92b304a5c1a..888c0faf693 100644
--- a/python/tidy/servo_tidy_tests/test_tidy.py
+++ b/python/tidy/servo_tidy_tests/test_tidy.py
@@ -58,6 +58,10 @@ class CheckTidiness(unittest.TestCase):
self.assertEqual('script should use `[[` instead of `[` for conditional testing', errors.next()[2])
self.assertNoMoreErrors(errors)
+ def test_apache2_incomplete(self):
+ errors = tidy.collect_errors_for_files(iterFile('apache2_license.rs'), [], [tidy.check_license])
+ self.assertEqual('incorrect license', errors.next()[2])
+
def test_rust(self):
errors = tidy.collect_errors_for_files(iterFile('rust_tidy.rs'), [], [tidy.check_rust], print_text=False)
self.assertEqual('use statement spans multiple lines', errors.next()[2])