diff options
author | Maciej Skrzypkowski <m.skrzypkows@samsung.com> | 2016-04-13 12:18:13 +0200 |
---|---|---|
committer | Maciej Skrzypkowski <m.skrzypkows@samsung.com> | 2016-04-13 12:18:13 +0200 |
commit | 13847a1131e8abae39d757e8d6bc517bcc1eaac5 (patch) | |
tree | 15f8facc7af255209546d29d3317a65fa711b4ff /python/tidy_self_test | |
parent | e8e354d5d3e6757c16912e7f5e6234ec5eece493 (diff) | |
download | servo-13847a1131e8abae39d757e8d6bc517bcc1eaac5.tar.gz servo-13847a1131e8abae39d757e8d6bc517bcc1eaac5.zip |
Test for check_spec function, for tidy.py #9152
Diffstat (limited to 'python/tidy_self_test')
-rw-r--r-- | python/tidy_self_test/speclink.rs | 9 | ||||
-rw-r--r-- | python/tidy_self_test/tidy_self_test.py | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/python/tidy_self_test/speclink.rs b/python/tidy_self_test/speclink.rs new file mode 100644 index 00000000000..6c27a70a7d0 --- /dev/null +++ b/python/tidy_self_test/speclink.rs @@ -0,0 +1,9 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +impl SpecLinkMethods for SpecLink { + fn Test(&self) -> f32 { + 0 + } +} diff --git a/python/tidy_self_test/tidy_self_test.py b/python/tidy_self_test/tidy_self_test.py index d7666b58b73..e2a49f71a65 100644 --- a/python/tidy_self_test/tidy_self_test.py +++ b/python/tidy_self_test/tidy_self_test.py @@ -59,6 +59,11 @@ class CheckTidiness(unittest.TestCase): self.assertEqual('use &[T] instead of &Vec<T>', errors.next()[2]) self.assertEqual('use &str instead of &String', errors.next()[2]) + def test_spec_link(self): + tidy.spec_base_path = "python/tidy_self_test/" + errors = tidy.collect_errors_for_files(iterFile('speclink.rs'), [], [tidy.check_spec]) + self.assertEqual('method declared in webidl is missing a comment with a specification link', errors.next()[2]) + def test_webidl(self): errors = tidy.collect_errors_for_files(iterFile('spec.webidl'), [tidy.check_webidl_spec], []) self.assertEqual('No specification link found.', errors.next()[2]) |