Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: PRESUBMIT_test.py

Issue 11413036: Fix include order PRESUBMIT check: #if-#elif-#else (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « PRESUBMIT.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT_test.py
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
index 1965d33520252ddd09f08d337620d1708a62c92a..413345840a50b47d7410abee87d9d9d11e84b02b 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()
« no previous file with comments | « PRESUBMIT.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698