| 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 387dd5cd193ec2530afe5c72f6f22acd9e4942ef..8649fc0dc6d25565b50f3e35b3122f016a891912 100644
|
| --- a/mojom/mojom_parser/formatter/formatter_test.go
|
| +++ b/mojom/mojom_parser/formatter/formatter_test.go
|
| @@ -12,8 +12,8 @@ import (
|
| func TestFormatMojom(t *testing.T) {
|
| original := `// Top line comment.
|
| [Attr1=1,
|
| -Attr2=2]
|
| -/* left comment */ module hello.world; // Right comment
|
| + Attr2=2]
|
| +/* left comment */ module hello.world; // Right comment
|
|
|
| // First block line 1
|
| // First block line 2
|
| @@ -27,10 +27,10 @@ import "afoo1.mojom";
|
| import "afoo2.mojom";
|
|
|
| [Attr1=1,
|
| -Attr2=2]
|
| -struct FooStruct { // FooStruct comment.
|
| + Attr2=2]
|
| +struct FooStruct { // FooStruct comment.
|
| // Field 1 comment.
|
| - int8 field1; // Field 1 comment.
|
| + int8 field1; // Field 1 comment.
|
| int16 field2 = 10;
|
| // Field3 comment.
|
| // Field3 other comment.
|
| @@ -43,30 +43,30 @@ struct FooUnion {
|
| };
|
|
|
| enum FooEnum {
|
| - VALUE1, // VALUE1 comment.
|
| - VALUE2 = 10, // VALUE2 comment.
|
| + VALUE1, // VALUE1 comment.
|
| + VALUE2 = 10, // VALUE2 comment.
|
|
|
| - // FooEnum Final Comment.
|
| + // FooEnum Final Comment.
|
| };
|
|
|
| // constant comment.
|
| -const int8 foo_constant1 = 10; // constant comment.
|
| -const int8 foo_constant2 = -10; // constant comment.
|
| -const float foo_constant3 = -10e10; // constant comment.
|
| -const int64 foo_constant4 = 0xAD10; // constant comment.
|
| -const int64 foo_constant5 = -0xAD10; // constant comment.
|
| +const int8 foo_constant1 = 10; // constant comment.
|
| +const int8 foo_constant2 = -10; // constant comment.
|
| +const float foo_constant3 = -10e10; // constant comment.
|
| +const int64 foo_constant4 = 0xAD10; // constant comment.
|
| +const int64 foo_constant5 = -0xAD10; // constant comment.
|
|
|
| // Interface Comment.
|
| -interface InterfaceFoo { // Interface comment.
|
| +interface InterfaceFoo { // Interface comment.
|
| const int8 const_in_interface = 20;
|
|
|
| - // Method 1 comment.
|
| - method1@5(int8 hello@10);
|
| - // Method 2 comment.
|
| - method2([MinVersion=5]int8 hello) => (Foo bar@20);
|
| + // Method 1 comment.
|
| + method1@5(int8 hello@10);
|
| + // Method 2 comment.
|
| + method2([MinVersion=5] int8 hello) => (Foo bar@20);
|
| method3();
|
| method4() => (Foo bar);
|
| - method5(int8 p1 /* p1 comment */, int16 p2); // method comment
|
| + method5(int8 p1 /* p1 comment */, int16 p2); // method comment
|
| };
|
|
|
| // Final Comments.
|
| @@ -74,6 +74,7 @@ interface InterfaceFoo { // Interface comment.
|
|
|
| // TODO(azani): Remove this and just fix the tabs.
|
| original = strings.Replace(original, "\t", " ", -1)
|
| + original = strings.Replace(original, "\t//", " //", -1)
|
|
|
| actual, err := FormatMojom("test.mojom", original)
|
| if err != nil {
|
|
|