Skip to content

Commit

Permalink
add test for update
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhhughes committed Feb 18, 2025
1 parent c61f505 commit a595055
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config_utilities/test/tests/yaml_parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,14 @@ TEST(YamlParsing, emptyCollections) {
EXPECT_EQ(expected, result);
}

TEST(YamlParsing, updateCorrect) {
SubSubConfig config;
// configs that don't pass checks should fail to update underlying config
EXPECT_FALSE(updateFromYaml(config, YAML::Load("i: -1")));
EXPECT_EQ(config.i, 1);
// configs that 't pass checks should update underlying config
EXPECT_TRUE(updateFromYaml(config, YAML::Load("i: 5")));
EXPECT_EQ(config.i, 5);
}

} // namespace config::test

0 comments on commit a595055

Please sign in to comment.