1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2023 Google LLC. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
8 use bad_names_proto::*;
9 use googletest::prelude::*;
12 fn test_reserved_keyword_in_accessors() {
13 let msg = Self__mangled_because_ident_isnt_a_legal_raw_identifier::new();
14 let res = msg.self__mangled_because_ident_isnt_a_legal_raw_identifier().r#for();
15 assert_that!(res, eq(0));
19 fn test_reserved_keyword_in_messages() {
20 let _ = r#enum::new();
21 let _ = Ref::new().r#const();
25 fn test_collision_in_accessors() {
26 let mut m = AccessorsCollide::new();
28 assert_that!(m.x_mut_5(), eq(false));
29 assert_that!(m.has_x_mut_5(), eq(true));
30 assert_that!(m.has_x(), eq(false));
31 assert_that!(m.has_set_x_2(), eq(false));