aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy_tests
diff options
context:
space:
mode:
authorUK992 <urbankrajnc92@gmail.com>2016-08-20 22:51:46 +0200
committerUK992 <urbankrajnc92@gmail.com>2016-08-20 22:51:46 +0200
commit74dba5cbdd35f2564db4d489f9bed17cbc190cf6 (patch)
treed124576ef055b55dcf4c4031c4b69a6787f015d6 /python/tidy/servo_tidy_tests
parent0ad905ae422a490f8d0f4a3666f453a319a985b7 (diff)
downloadservo-74dba5cbdd35f2564db4d489f9bed17cbc190cf6.tar.gz
servo-74dba5cbdd35f2564db4d489f9bed17cbc190cf6.zip
Check for errors in tidy config file
Diffstat (limited to 'python/tidy/servo_tidy_tests')
-rw-r--r--python/tidy/servo_tidy_tests/servo-tidy.toml13
-rw-r--r--python/tidy/servo_tidy_tests/test_tidy.py7
2 files changed, 20 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy_tests/servo-tidy.toml b/python/tidy/servo_tidy_tests/servo-tidy.toml
new file mode 100644
index 00000000000..0aea4527b99
--- /dev/null
+++ b/python/tidy/servo_tidy_tests/servo-tidy.toml
@@ -0,0 +1,13 @@
+key-outside = ""
+
+[configs]
+skip-check-length = false
+skip-check-licenses = false
+wrong-key = false
+
+[wrong]
+wrong-key = true
+
+[ignore]
+files = []
+directories = []
diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py
index bb1cb8ce61c..c8751ea59c4 100644
--- a/python/tidy/servo_tidy_tests/test_tidy.py
+++ b/python/tidy/servo_tidy_tests/test_tidy.py
@@ -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])