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

Side by Side Diff: mojom/mojom_parser/formatter/formatter_test.go

Issue 1766463002: Implement formatting exclusion. (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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package formatter 5 package formatter
6 6
7 import ( 7 import (
8 "strings" 8 "strings"
9 "testing" 9 "testing"
10 ) 10 )
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 int16 field2@5; 42 int16 field2@5;
43 }; 43 };
44 44
45 enum FooEnum { 45 enum FooEnum {
46 VALUE1, // VALUE1 comment. 46 VALUE1, // VALUE1 comment.
47 VALUE2 = 10, // VALUE2 comment. 47 VALUE2 = 10, // VALUE2 comment.
48 48
49 // FooEnum Final Comment. 49 // FooEnum Final Comment.
50 }; 50 };
51 51
52 // no-format
53
54 enum SomeWeirdFormat { VALUE1 = 10, VALUE2 = 20};
55
56
57
58
59 // end-no-format
60
52 // constant comment. 61 // constant comment.
53 const int8 foo_constant1 = 10; // constant comment. 62 const int8 foo_constant1 = 10; // constant comment.
54 const int8 foo_constant2 = -10; // constant comment. 63 const int8 foo_constant2 = -10; // constant comment.
55 const float foo_constant3 = -10e10; // constant comment. 64 const float foo_constant3 = -10e10; // constant comment.
56 const int64 foo_constant4 = 0xAD10; // constant comment. 65 const int64 foo_constant4 = 0xAD10; // constant comment.
57 const int64 foo_constant5 = -0xAD10; // constant comment. 66 const int64 foo_constant5 = -0xAD10; // constant comment.
58 67
59 // Interface Comment. 68 // Interface Comment.
60 interface InterfaceFoo { // Interface comment. 69 interface InterfaceFoo { // Interface comment.
61 const int8 const_in_interface = 20; 70 const int8 const_in_interface = 20;
(...skipping 19 matching lines...) Expand all
81 90
82 actual, err := FormatMojom("test.mojom", original) 91 actual, err := FormatMojom("test.mojom", original)
83 if err != nil { 92 if err != nil {
84 t.Fatalf("Parser was not supposed to fail: %s", err.Error()) 93 t.Fatalf("Parser was not supposed to fail: %s", err.Error())
85 } 94 }
86 95
87 if original != actual { 96 if original != actual {
88 t.Fatalf("\nExpected:\n%v\n\n*****\n\nActual:\n%v eof", original , actual) 97 t.Fatalf("\nExpected:\n%v\n\n*****\n\nActual:\n%v eof", original , actual)
89 } 98 }
90 } 99 }
OLDNEW
« 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