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

Unified Diff: mojom/generators/go/templates/interfaces_test.go

Issue 2077113002: Handle interfaces with a ServiceName in the go bindings generator. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix names issue. Created 4 years, 6 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/generators/go/templates/interfaces.go ('k') | mojom/generators/go/templates/templates.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/generators/go/templates/interfaces_test.go
diff --git a/mojom/generators/go/templates/interfaces_test.go b/mojom/generators/go/templates/interfaces_test.go
index 684749a4e1e0732574f188bae4b18327214e2026..aa2893e4f4d1c7bacf588bddcaf7ca7739e985a3 100644
--- a/mojom/generators/go/templates/interfaces_test.go
+++ b/mojom/generators/go/templates/interfaces_test.go
@@ -64,3 +64,28 @@ const someInterface_SecondMethod_Ordinal uint32 = 21
check(t, expected, "MethodOrdinals", i)
}
+
+func TestServiceName(t *testing.T) {
+ expected := `const someInterface_Name string = "SomeService"
+
+func (r *SomeInterface_Request) Name() string {
+ return someInterface_Name
+}
+
+func (p *SomeInterface_Pointer) Name() string {
+ return someInterface_Name
+}
+
+func (f *SomeInterface_ServiceFactory) Name() string {
+ return someInterface_Name
+}`
+
+ serviceName := "SomeService"
+ i := translator.InterfaceTemplate{
+ Name: "SomeInterface",
+ PrivateName: "someInterface",
+ ServiceName: &serviceName,
+ }
+
+ check(t, expected, "ServiceDecl", i)
+}
« no previous file with comments | « mojom/generators/go/templates/interfaces.go ('k') | mojom/generators/go/templates/templates.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698