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

Side by Side Diff: mojo/go/tests/enums_test.go

Issue 1943643002: Go bindings: Change generated enum value constants to be typed as the enum type. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « mojo/go/BUILD.gn ('k') | mojo/public/interfaces/bindings/tests/test_enums.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 package tests
6
7 import (
8 "mojo/public/interfaces/bindings/tests/test_enums"
9 "testing"
10 )
11
12 func TestEnums(t *testing.T) {
13 if test_enums.TestEnum_Foo != IdentityEnum1(test_enums.TestEnum_Foo) {
14 t.Errorf("IdentityEnum1 failure.")
15 }
16
17 if test_enums.TestEnum2_Foo != IdentityEnum2(test_enums.TestEnum2_Foo) {
18 t.Errorf("IdentityEnum1 failure.")
19 }
20 }
21
22 func IdentityEnum1(x test_enums.TestEnum) test_enums.TestEnum {
23 return x
24 }
25
26 func IdentityEnum2(x test_enums.TestEnum2) test_enums.TestEnum2 {
27 return x
28 }
OLDNEW
« no previous file with comments | « mojo/go/BUILD.gn ('k') | mojo/public/interfaces/bindings/tests/test_enums.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698