Add a test for repeated field orderings demonstrating that MessageDifferencer::Equals and MessageDifferencer::Equivalent treat these cases in the same way.

PiperOrigin-RevId: 619712729
pull/16333/head
Protobuf Team Bot 8 months ago committed by Copybara-Service
parent 9b2b61cfb4
commit 62620979c2
  1. 15
      src/google/protobuf/util/message_differencer_unittest.cc

@ -1153,6 +1153,21 @@ TEST(MessageDifferencerTest, BasicFieldOrderingInequalityTest) {
EXPECT_FALSE(util::MessageDifferencer::Equals(msg1, msg2));
}
TEST(MessageDifferencerTest, BasicRepeatedFieldOrderingInequalityTest) {
// Create the testing protos
unittest::MoreString msg1;
unittest::MoreString msg2;
msg1.add_data("a");
msg1.add_data("b");
msg2.add_data("b");
msg2.add_data("a");
// Compare
EXPECT_FALSE(util::MessageDifferencer::Equals(msg1, msg2));
EXPECT_FALSE(util::MessageDifferencer::Equivalent(msg1, msg2));
}
TEST(MessageDifferencerTest, BasicExtensionTest) {
// Create the testing protos
unittest::TestAllExtensions msg1;

Loading…
Cancel
Save