diff options
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() |