You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2021/10/06 18:00:25 UTC

[royale-compiler] 02/07: formatter: extra test for block comments

This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit 92c76fee90a3590f0edecd0e5716c3a83e7e974b
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Wed Oct 6 10:14:49 2021 -0700

    formatter: extra test for block comments
---
 .../royale/formatter/TestMultiLineComment.java     | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/formatter/src/test/java/org/apache/royale/formatter/TestMultiLineComment.java b/formatter/src/test/java/org/apache/royale/formatter/TestMultiLineComment.java
index c2fa2c2..c3f8b24 100644
--- a/formatter/src/test/java/org/apache/royale/formatter/TestMultiLineComment.java
+++ b/formatter/src/test/java/org/apache/royale/formatter/TestMultiLineComment.java
@@ -85,4 +85,27 @@ public class TestMultiLineComment extends BaseFormatterTests {
 				result);
 	}
 
+	@Test
+	public void testPreserveMultilineFormatting() {
+		FORMATTER formatter = new FORMATTER();
+		formatter.insertSpaceAfterKeywordsInControlFlowStatements = true;
+		formatter.placeOpenBraceOnNewLine = true;
+		formatter.insertSpaces = false;
+		String result = formatter.formatText(
+		// @formatter:off
+			"/*\n" +
+			"\tthis is a comment\n" +
+			"*/",
+			// @formatter:on
+			problems
+		);
+		assertEquals(
+		// @formatter:off
+				"/*\n" +
+				"\tthis is a comment\n" +
+				"*/",
+				// @formatter:on
+				result);
+	}
+
 }