mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
[tidy] Add test for existing json functionality
This commit is contained in:
parent
4fafcb121f
commit
28399d0877
2 changed files with 9 additions and 0 deletions
4
python/tidy/servo_tidy_tests/malformed_json.json
Normal file
4
python/tidy/servo_tidy_tests/malformed_json.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"key": "value",
|
||||
"other_key": "value_with_bad_quote'
|
||||
}
|
|
@ -104,6 +104,11 @@ class CheckTidiness(unittest.TestCase):
|
|||
self.assertEqual('emacs file variables present', errors.next()[2])
|
||||
self.assertNoMoreErrors(errors)
|
||||
|
||||
def test_malformed_json(self):
|
||||
errors = tidy.collect_errors_for_files(iterFile('malformed_json.json'), [tidy.check_json], [], print_text=False)
|
||||
self.assertEqual('Invalid control character at: line 3 column 40 (char 61)', errors.next()[2])
|
||||
self.assertNoMoreErrors(errors)
|
||||
|
||||
def test_lock(self):
|
||||
errors = tidy.collect_errors_for_files(iterFile('duplicated_package.lock'), [tidy.check_lock], [], print_text=False)
|
||||
msg = """duplicate versions for package "test"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue