Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a proto comparison macro #467

Closed
eric846 opened this issue Aug 19, 2020 · 2 comments
Closed

Add a proto comparison macro #467

eric846 opened this issue Aug 19, 2020 · 2 comments

Comments

@eric846
Copy link
Contributor

eric846 commented Aug 19, 2020

Figure out how to make a utility that does this:

  Envoy::ProtobufTypes::MessagePtr empty_config = config_factory.createEmptyConfigProto();
  FakeMetricsPluginConfig expected_config;
  EXPECT_EQ(empty_config->DebugString(), expected_config.DebugString());
  EXPECT_TRUE(Envoy::MessageUtil()(*empty_config, expected_config));

The DebugString version is to make the output clearer for humans. The MessageUtil part is a more complete comparison that may include parts of the proto missing from the DebugString output.

@eric846
Copy link
Contributor Author

eric846 commented Aug 20, 2020

Also consider

  EXPECT_TRUE(::Envoy::Protobuf::util::MessageDifferencer::Equivalent(*empty_config, expected_config));

for the second part, which does the same thing and is clearer.

@eric846
Copy link
Contributor Author

eric846 commented Aug 20, 2020

This is a duplicate of #433.

@eric846 eric846 closed this as completed Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant