Add a test for repeated field orderings demonstrating that MessageDifferencer::Equals and MessageDifferencer::Equivalent treat these cases in the same way.
PiperOrigin-RevId: 619712729pull/16333/head
parent
9b2b61cfb4
commit
62620979c2
|
@ -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…
Reference in New Issue