Skip to content

Commit

Permalink
Slightly extend the Repeated test case.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 712546186
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Jan 6, 2025
1 parent 883034a commit 1c0b664
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rust/test/shared/accessors_repeated_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use googletest::prelude::*;
use paste::paste;
use protobuf::{AsMut, AsView, Repeated};
use protobuf::{proto, AsMut, AsView, Repeated};
use unittest_rust_proto::{test_all_types, test_all_types::NestedMessage, TestAllTypes};

macro_rules! generate_repeated_numeric_test {
Expand Down Expand Up @@ -249,6 +249,11 @@ fn test_repeated_message_setter() {
fn test_repeated_message_drop() {
let mut repeated = Repeated::<TestAllTypes>::new();
repeated.as_mut().push(TestAllTypes::new());

{
let v: Vec<TestAllTypes> = vec![proto!(TestAllTypes { optional_int32: 1 })];
repeated.as_mut().extend(v.iter().cloned());
}
}

#[gtest]
Expand Down

0 comments on commit 1c0b664

Please sign in to comment.