PiperOrigin-RevId: 566403598pull/14123/head
parent
df1aad1617
commit
80a4df3306
5 changed files with 123 additions and 0 deletions
@ -0,0 +1,18 @@ |
||||
// Protocol Buffers - Google's data interchange format |
||||
// Copyright 2023 Google LLC. All rights reserved. |
||||
// |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file or at |
||||
// https://developers.google.com/open-source/licenses/bsd |
||||
|
||||
syntax = "proto2"; |
||||
|
||||
package nest; |
||||
|
||||
message Outer { |
||||
message Inner { |
||||
optional int32 num = 1; |
||||
optional bool boolean = 2; |
||||
} |
||||
optional Inner inner = 1; |
||||
} |
@ -0,0 +1,16 @@ |
||||
// Protocol Buffers - Google's data interchange format
|
||||
// Copyright 2023 Google LLC. All rights reserved.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd
|
||||
|
||||
use nested_proto::nest::Outer; |
||||
|
||||
#[test] |
||||
fn test_simple_nested_proto() { |
||||
let outer_msg = Outer::new(); |
||||
// TODO(b/285309454): passing cpp, segfaulting upb
|
||||
assert_eq!(outer_msg.inner().num(), 0); |
||||
assert!(!outer_msg.inner().boolean()); |
||||
} |
Loading…
Reference in new issue