summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT_unittest.py
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-10 13:55:09 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-10 13:55:09 +0000
commit2fcccc7295206f24e1bc8526b40273cc6c30373e (patch)
treec92ee96f5dc55c12176a4f61298f640bca11c78d /PRESUBMIT_unittest.py
parent7afa9c92e0176b35a01fc28acbe7ca110a0d8871 (diff)
downloadchromium_src-2fcccc7295206f24e1bc8526b40273cc6c30373e.zip
chromium_src-2fcccc7295206f24e1bc8526b40273cc6c30373e.tar.gz
chromium_src-2fcccc7295206f24e1bc8526b40273cc6c30373e.tar.bz2
Add end of file newline checks to PRESUBMIT.py.
This makes sure that: - Files end in a newline character, this is otherwise a fatal error with GCC. - Files end in only one newline character, and not a bunch of whitespace. Review URL: http://codereview.chromium.org/43017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT_unittest.py')
-rwxr-xr-xPRESUBMIT_unittest.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/PRESUBMIT_unittest.py b/PRESUBMIT_unittest.py
index b8183c2..6f2ff00 100755
--- a/PRESUBMIT_unittest.py
+++ b/PRESUBMIT_unittest.py
@@ -62,24 +62,24 @@ class PresubmitUnittest(unittest.TestCase):
MockAffectedFile('foo/blat/source.py'),
]
self.file_contents = 'file with \n\terror\nhere\r\nyes there'
- # 3 source files, 2 errors by file + 1 global CR error.
- self.failUnless(len(PRESUBMIT.LocalChecks(api, MockOutputApi)) == 7)
+ # 3 source files, 2 errors by file + 1 global CR + 1 global EOF error.
+ self.failUnless(len(PRESUBMIT.LocalChecks(api, MockOutputApi)) == 8)
- self.file_contents = 'file\twith\ttabs'
+ self.file_contents = 'file\twith\ttabs\n'
# 3 source files, 1 error by file.
self.failUnless(len(PRESUBMIT.LocalChecks(api, MockOutputApi)) == 3)
- self.file_contents = 'file\rusing\rCRs'
+ self.file_contents = 'file\rusing\rCRs\n'
# One global CR error.
self.failUnless(len(PRESUBMIT.LocalChecks(api, MockOutputApi)) == 1)
self.failUnless(
len(PRESUBMIT.LocalChecks(api, MockOutputApi)[0].items) == 3)
- self.file_contents = 'both\ttabs and\r\nCRLF'
+ self.file_contents = 'both\ttabs and\r\nCRLF\n'
# 3 source files, 1 error by file + 1 global CR error.
self.failUnless(len(PRESUBMIT.LocalChecks(api, MockOutputApi)) == 4)
- self.file_contents = 'file with\nzero \\t errors \\r\\n'
+ self.file_contents = 'file with\nzero \\t errors \\r\\n\n'
self.failIf(PRESUBMIT.LocalChecks(api, MockOutputApi))