OLD | NEW |
1 # -*- coding: utf-8; -*- | 1 # -*- coding: utf-8; -*- |
2 # | 2 # |
3 # Copyright (C) 2009 Google Inc. All rights reserved. | 3 # Copyright (C) 2009 Google Inc. All rights reserved. |
4 # Copyright (C) 2009 Torch Mobile Inc. | 4 # Copyright (C) 2009 Torch Mobile Inc. |
5 # Copyright (C) 2009 Apple Inc. All rights reserved. | 5 # Copyright (C) 2009 Apple Inc. All rights reserved. |
6 # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) | 6 # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) |
7 # | 7 # |
8 # Redistribution and use in source and binary forms, with or without | 8 # Redistribution and use in source and binary forms, with or without |
9 # modification, are permitted provided that the following conditions are | 9 # modification, are permitted provided that the following conditions are |
10 # met: | 10 # met: |
(...skipping 19 matching lines...) Expand all Loading... |
30 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 30 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
31 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 31 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
32 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
33 | 33 |
34 """Unit tests for style.py.""" | 34 """Unit tests for style.py.""" |
35 | 35 |
36 import logging | 36 import logging |
37 import os | 37 import os |
38 import unittest | 38 import unittest |
39 | 39 |
40 from webkitpy.common.system.logtesting import LoggingTestCase | 40 from webkitpy.common.system.log_testing import LoggingTestCase |
41 from webkitpy.common.system.logtesting import TestLogStream | 41 from webkitpy.common.system.log_testing import TestLogStream |
42 from webkitpy.style import checker as style | 42 from webkitpy.style import checker as style |
43 from webkitpy.style.checker import _all_categories | 43 from webkitpy.style.checker import _all_categories |
44 from webkitpy.style.checker import _BASE_FILTER_RULES | 44 from webkitpy.style.checker import _BASE_FILTER_RULES |
45 from webkitpy.style.checker import _MAX_REPORTS_PER_CATEGORY | 45 from webkitpy.style.checker import _MAX_REPORTS_PER_CATEGORY |
46 from webkitpy.style.checker import _PATH_RULES_SPECIFIER as PATH_RULES_SPECIFIER | 46 from webkitpy.style.checker import _PATH_RULES_SPECIFIER as PATH_RULES_SPECIFIER |
47 from webkitpy.style.checker import check_webkit_style_configuration | 47 from webkitpy.style.checker import check_webkit_style_configuration |
48 from webkitpy.style.checker import check_webkit_style_parser | 48 from webkitpy.style.checker import check_webkit_style_parser |
49 from webkitpy.style.checker import CheckerDispatcher | 49 from webkitpy.style.checker import CheckerDispatcher |
50 from webkitpy.style.checker import configure_logging | 50 from webkitpy.style.checker import configure_logging |
51 from webkitpy.style.checker import StyleProcessor | 51 from webkitpy.style.checker import StyleProcessor |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 """Test that carriage returns aren't stripped from files that are allowe
d to contain them.""" | 803 """Test that carriage returns aren't stripped from files that are allowe
d to contain them.""" |
804 file_path = 'carriage_returns_allowed.txt' | 804 file_path = 'carriage_returns_allowed.txt' |
805 lines = ['line1\r', 'line2\r'] | 805 lines = ['line1\r', 'line2\r'] |
806 line_numbers = [100] | 806 line_numbers = [100] |
807 self._processor.process(lines=lines, | 807 self._processor.process(lines=lines, |
808 file_path=file_path, | 808 file_path=file_path, |
809 line_numbers=line_numbers) | 809 line_numbers=line_numbers) |
810 # The carriage return checker should never have been invoked, and so | 810 # The carriage return checker should never have been invoked, and so |
811 # should not have saved off any lines. | 811 # should not have saved off any lines. |
812 self.assertFalse(hasattr(self.carriage_checker, 'lines')) | 812 self.assertFalse(hasattr(self.carriage_checker, 'lines')) |
OLD | NEW |