Title: [160006] trunk/Tools
Revision
160006
Author
[email protected]
Date
2013-12-03 09:15:18 -0800 (Tue, 03 Dec 2013)

Log Message

Remove function from TextChecker
https://bugs.webkit.org/show_bug.cgi?id=125148

Patch by Tamas Gergely <[email protected]> on 2013-12-03
Reviewed by Darin Adler.

The process_file_data is used only from the unit tests, so it is simply moved there.

* Scripts/webkitpy/style/checkers/text.py:
(TextChecker.check):
* Scripts/webkitpy/style/checkers/text_unittest.py:
(TextStyleTestCase.process_file_data):
(TextStyleTestCase.assertNoError):
(TextStyleTestCase.assertError):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (160005 => 160006)


--- trunk/Tools/ChangeLog	2013-12-03 17:12:38 UTC (rev 160005)
+++ trunk/Tools/ChangeLog	2013-12-03 17:15:18 UTC (rev 160006)
@@ -1,3 +1,19 @@
+2013-12-03  Tamas Gergely  <[email protected]>
+
+        Remove function from TextChecker
+        https://bugs.webkit.org/show_bug.cgi?id=125148
+
+        Reviewed by Darin Adler.
+
+        The process_file_data is used only from the unit tests, so it is simply moved there.
+
+        * Scripts/webkitpy/style/checkers/text.py:
+        (TextChecker.check):
+        * Scripts/webkitpy/style/checkers/text_unittest.py:
+        (TextStyleTestCase.process_file_data):
+        (TextStyleTestCase.assertNoError):
+        (TextStyleTestCase.assertError):
+
 2013-12-03  Dániel Bátyai  <[email protected]>
 
         Remove get_test() and reference test names directly instead.

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/text.py (160005 => 160006)


--- trunk/Tools/Scripts/webkitpy/style/checkers/text.py	2013-12-03 17:12:38 UTC (rev 160005)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/text.py	2013-12-03 17:15:18 UTC (rev 160006)
@@ -42,10 +42,3 @@
 
     def check(self, lines):
         self._tab_checker.check(lines)
-
-
-# FIXME: Remove this function (requires refactoring unit tests).
-def process_file_data(filename, lines, error):
-    checker = TextChecker(filename, error)
-    checker.check(lines)
-

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/text_unittest.py (160005 => 160006)


--- trunk/Tools/Scripts/webkitpy/style/checkers/text_unittest.py	2013-12-03 17:12:38 UTC (rev 160005)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/text_unittest.py	2013-12-03 17:15:18 UTC (rev 160006)
@@ -36,6 +36,10 @@
 class TextStyleTestCase(unittest.TestCase):
     """TestCase for text_style.py"""
 
+    def process_file_data(self, filename, lines, error):
+        checker = TextChecker(filename, error)
+        checker.check(lines)
+
     def assertNoError(self, lines):
         """Asserts that the specified lines has no errors."""
         self.had_error = False
@@ -44,7 +48,7 @@
             """Records if an error occurs."""
             self.had_error = True
 
-        text_style.process_file_data('', lines, error_for_test)
+        self.process_file_data('', lines, error_for_test)
         self.assertFalse(self.had_error, '%s should not have any errors.' % lines)
 
     def assertError(self, lines, expected_line_number):
@@ -57,7 +61,7 @@
             self.assertEqual('whitespace/tab', category)
             self.had_error = True
 
-        text_style.process_file_data('', lines, error_for_test)
+        self.process_file_data('', lines, error_for_test)
         self.assertTrue(self.had_error, '%s should have an error [whitespace/tab].' % lines)
 
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to