| OLD | NEW |
| 1 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) | 1 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions | 4 # modification, are permitted provided that the following conditions |
| 5 # are met: | 5 # are met: |
| 6 # 1. Redistributions of source code must retain the above copyright | 6 # 1. Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # 2. Redistributions in binary form must reproduce the above copyright | 8 # 2. Redistributions in binary form must reproduce the above copyright |
| 9 # notice, this list of conditions and the following disclaimer in the | 9 # notice, this list of conditions and the following disclaimer in the |
| 10 # documentation and/or other materials provided with the distribution. | 10 # documentation and/or other materials provided with the distribution. |
| 11 # | 11 # |
| 12 # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY | 12 # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY |
| 13 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 13 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 14 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 14 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 15 # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 15 # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
| 16 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 16 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 17 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 17 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 18 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | 18 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 19 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 19 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 20 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 20 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 21 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 21 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 22 | 22 |
| 23 """Unit tests for error_handlers.py.""" | 23 """Unit tests for error_handlers.py.""" |
| 24 | 24 |
| 25 import unittest | 25 import unittest |
| 26 | 26 |
| 27 from checker import StyleProcessorConfiguration | 27 from webkitpy.style.checker import StyleProcessorConfiguration |
| 28 from error_handlers import DefaultStyleErrorHandler | 28 from webkitpy.style.error_handlers import DefaultStyleErrorHandler |
| 29 from filter import FilterConfiguration | 29 from webkitpy.style.filter import FilterConfiguration |
| 30 | 30 |
| 31 | 31 |
| 32 class DefaultStyleErrorHandlerTest(unittest.TestCase): | 32 class DefaultStyleErrorHandlerTest(unittest.TestCase): |
| 33 | 33 |
| 34 """Tests the DefaultStyleErrorHandler class.""" | 34 """Tests the DefaultStyleErrorHandler class.""" |
| 35 | 35 |
| 36 def setUp(self): | 36 def setUp(self): |
| 37 self._error_messages = [] | 37 self._error_messages = [] |
| 38 self._error_count = 0 | 38 self._error_count = 0 |
| 39 | 39 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 ["foo.h(50): message [whitespace/tab] [5]\n"]) | 187 ["foo.h(50): message [whitespace/tab] [5]\n"]) |
| 188 | 188 |
| 189 # Error on non-modified line after turning off line filtering: error. | 189 # Error on non-modified line after turning off line filtering: error. |
| 190 error_handler.turn_off_line_filtering() | 190 error_handler.turn_off_line_filtering() |
| 191 self._call_error_handler(error_handler, confidence, line_number=60) | 191 self._call_error_handler(error_handler, confidence, line_number=60) |
| 192 self.assertEqual(2, self._error_count) | 192 self.assertEqual(2, self._error_count) |
| 193 self.assertEqual(self._error_messages, | 193 self.assertEqual(self._error_messages, |
| 194 ['foo.h(50): message [whitespace/tab] [5]\n', | 194 ['foo.h(50): message [whitespace/tab] [5]\n', |
| 195 'foo.h(60): message [whitespace/tab] [5]\n', | 195 'foo.h(60): message [whitespace/tab] [5]\n', |
| 196 'Suppressing further [whitespace/tab] reports for this
file.\n']) | 196 'Suppressing further [whitespace/tab] reports for this
file.\n']) |
| OLD | NEW |