peter-toth commented on a change in pull request #28041: [SPARK-30564][SQL] 
Improved extra new line and comment remove
URL: https://github.com/apache/spark/pull/28041#discussion_r399665467
 
 

 ##########
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeFormatterSuite.scala
 ##########
 @@ -61,28 +61,36 @@ class CodeFormatterSuite extends SparkFunSuite {
         |  * line
         |  * comments
         |  */
+        |  // comment
         |
         |public function() {
         |/*comment*/
         |  /*comment_with_space*/
-        |code_body
+        |code_body /* comment */ code_body/**/code_body // comment
         |//comment
-        |code_body
+        |code_body /*
+        |  * multi
+        |  * line
+        |  * comments
+        |  */
         |  //comment_with_space
         |
-        |code_body
+        |code_body // comment
+        | /*
+        |  * multi
+        |  * line
+        |  * comments
+        |  */
         |}
       """.stripMargin
 
     val reducedCode = CodeFormatter.stripExtraNewLinesAndComments(code)
     assert(reducedCode ===
-      """
-        |public function() {
+      """public function() {
+        |code_body code_body code_body
         |code_body
         |code_body
-        |code_body
-        |}
-      """.stripMargin)
+        |}""".stripMargin)
 
 Review comment:
   ok

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to