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

Unified Diff: PRESUBMIT_test.py

Issue 1309283003: Fix presubmit script for .cc files which include system files first. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made test use windows.h which is the more realistic case Created 5 years, 3 months 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 e0de9674d3372498ad8ea94828154e46135dd9be..3e174011ddfa2ffb69432eab4f606fce2b7d3454 100755
--- a/PRESUBMIT_test.py
+++ b/PRESUBMIT_test.py
@@ -134,6 +134,18 @@ class IncludeOrderTest(unittest.TestCase):
mock_input_api, mock_file, range(1, len(contents) + 1))
self.assertEqual(0, len(warnings))
+ def testSpecialFirstInclude7(self):
+ mock_input_api = MockInputApi()
+ contents = ['#include <windows.h>',
+ '#include "some/path/foo.h"',
+ '#include <set>',
+ '#include "a/header.h"']
+ mock_file = MockFile('some/path/foo.cc', contents)
+ warnings = PRESUBMIT._CheckIncludeOrderInFile(
+ mock_input_api, mock_file, range(1, len(contents) + 1))
+ print warnings
+ self.assertEqual(0, len(warnings))
+
def testOrderAlreadyWrong(self):
scope = [(1, '#include "b.h"'),
(2, '#include "a.h"'),
« 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