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

test: make YamlLoadFromStringFail less picky about error msg. #4141

Merged
merged 1 commit into from
Aug 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions test/common/protobuf/utility_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,9 @@ TEST(UtilityTest, YamlLoadFromStringFail) {
"Unable to convert YAML as JSON: /home/configs/config.yaml");
// Verify loadFromYaml throws error when the input leads to an Array. This error message is
// arguably more useful than only "Unable to convert YAML as JSON".
EXPECT_THROW_WITH_MESSAGE(MessageUtil::loadFromYaml("- node: { id: node1 }", bootstrap),
EnvoyException,
"Unable to parse JSON as proto (INVALID_ARGUMENT:: invalid name : Root "
"element must be a message.): [{\"node\":{\"id\":\"node1\"}}]");
EXPECT_THROW_WITH_REGEX(MessageUtil::loadFromYaml("- node: { id: node1 }", bootstrap),
EnvoyException,
"Unable to parse JSON as proto.*Root element must be a message.*");
}

TEST(DurationUtilTest, OutOfRange) {
Expand Down