Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1369)

Unified Diff: mojom/mojom_parser/formatter/formatter_test.go

Issue 1829893002: Formatter: Avoid extraneous empty lines at the end of a block. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/tools/bindings/mojom_tool/bin/mac64/mojom.sha1 ('k') | mojom/mojom_parser/formatter/printer.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/mojom_parser/formatter/formatter_test.go
diff --git a/mojom/mojom_parser/formatter/formatter_test.go b/mojom/mojom_parser/formatter/formatter_test.go
index ae745a3ddff15d2ee7442d71900c66f9b0b7bc63..ff072f4d9ed53d78494a44d63088d5541635d66d 100644
--- a/mojom/mojom_parser/formatter/formatter_test.go
+++ b/mojom/mojom_parser/formatter/formatter_test.go
@@ -109,3 +109,26 @@ interface InterfaceFoo { // Interface comment.
t.Fatalf("\nExpected:\n%v\n\n*****\n\nActual:\n%v eof", original, actual)
}
}
+
+func TestFormatNoExtraFinalBlankLine(t *testing.T) {
+ original := `interface ImagePipe {
+ // Some comment.
+ FlushImages();
+
+};
+`
+
+ expected := `interface ImagePipe {
+ // Some comment.
+ FlushImages();
+};
+`
+ actual, err := FormatMojom("test.mojom", original)
+ if err != nil {
+ t.Fatalf("Parser was not supposed to fail: %s", err.Error())
+ }
+
+ if expected != actual {
+ t.Fatalf("\nExpected:\n%v\n\n*****\n\nActual:\n%v eof", expected, actual)
+ }
+}
« no previous file with comments | « mojo/public/tools/bindings/mojom_tool/bin/mac64/mojom.sha1 ('k') | mojom/mojom_parser/formatter/printer.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698