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

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

Issue 1833493002: Replace ErrorExit with log.Fatal in the mojom tool. (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 | « mojom/mojom_parser/fmt_cmd.go ('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) {
rudominer 2016/03/23 19:39:57 I'm guessing this delta should not be here.
azani 2016/03/23 20:52:22 gone.
+ 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 | « mojom/mojom_parser/fmt_cmd.go ('k') | mojom/mojom_parser/formatter/printer.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698