Index: mojom/mojom_parser/formatter/printer_test.go |
diff --git a/mojom/mojom_parser/formatter/printer_test.go b/mojom/mojom_parser/formatter/printer_test.go |
index 6014009214157408f329ccbf7c03e7bfbe79215b..2e2888aff398d6d0a6216caf21938b0343e720ed 100644 |
--- a/mojom/mojom_parser/formatter/printer_test.go |
+++ b/mojom/mojom_parser/formatter/printer_test.go |
@@ -140,6 +140,22 @@ import "foo2.mojom"; |
checkEq(t, expected, p.result()) |
} |
+func TestWriteSingleLineComment(t *testing.T) { |
+ commentText := "// Hello world." |
+ token := lexer.Token{Kind: lexer.SingleLineComment, Text: commentText} |
+ p := getNewPrinter() |
+ p.writeSingleLineComment(token) |
+ checkEq(t, commentText, p.result()) |
+} |
+ |
+func TestWriteSingleLineCommentAddSpace(t *testing.T) { |
+ commentText := "//Hello world." |
+ token := lexer.Token{Kind: lexer.SingleLineComment, Text: commentText} |
+ p := getNewPrinter() |
+ p.writeSingleLineComment(token) |
+ checkEq(t, "// Hello world.", p.result()) |
+} |
+ |
func TestWriteMultilineComments(t *testing.T) { |
commentText := `/* |
* Some comment. |