diff options
author | marja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-16 12:18:27 +0000 |
---|---|---|
committer | marja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-16 12:18:27 +0000 |
commit | 2309b0fa040631b96018a23b0fc88d538e99ee74 (patch) | |
tree | 1826725c912a0cd3aa075795902b54638a66a76e /PRESUBMIT_test.py | |
parent | 5c38792fb45ba456bec05403eec4f518d4975b9b (diff) | |
download | chromium_src-2309b0fa040631b96018a23b0fc88d538e99ee74.zip chromium_src-2309b0fa040631b96018a23b0fc88d538e99ee74.tar.gz chromium_src-2309b0fa040631b96018a23b0fc88d538e99ee74.tar.bz2 |
Fix include order PRESUBMIT check: #if-#elif-#else
BUG=161390
Review URL: https://codereview.chromium.org/11413036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168191 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT_test.py')
-rwxr-xr-x | PRESUBMIT_test.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py index 1965d33..4133458 100755 --- a/PRESUBMIT_test.py +++ b/PRESUBMIT_test.py @@ -155,6 +155,22 @@ class IncludeOrderTest(unittest.TestCase): self.assertEqual(1, len(warnings)) self.assertTrue('2' in warnings[0]) + def testIfElifElseEndif(self): + mock_input_api = MockInputApi() + contents = ['#include "e.h"', + '#if foo', + '#include "d.h"', + '#elif bar', + '#include "c.h"', + '#else', + '#include "b.h"', + '#endif', + '#include "a.h"'] + mock_file = MockFile('', contents) + warnings = PRESUBMIT._CheckIncludeOrderInFile( + mock_input_api, mock_file, True, range(1, len(contents) + 1)) + self.assertEqual(0, len(warnings)) + if __name__ == '__main__': unittest.main() |