File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 22
33#include " boost/json.hpp"
44#include " catch2/catch_test_macros.hpp"
5+ #include " catch2/matchers/catch_matchers_string.hpp"
56
67using namespace phlex ::experimental;
78
9+ TEST_CASE (" Check parameter-retrieval errors" , " [config]" )
10+ {
11+ boost::json::object underlying_config;
12+ underlying_config[" b" ] = 2.5 ;
13+ configuration const config{underlying_config};
14+
15+ CHECK (config.keys () == std::vector<std::string>{" b" });
16+
17+ CHECK_THROWS_WITH (config.get <int >(" a" ),
18+ Catch::Matchers::ContainsSubstring (" Error retrieving parameter 'a'" ));
19+ CHECK_THROWS_WITH (config.get <std::string>(" b" ),
20+ Catch::Matchers::ContainsSubstring (" Error retrieving parameter 'b'" ));
21+ }
22+
823TEST_CASE (" Retrieve value that is a configuration object" , " [config]" )
924{
1025 boost::json::object underlying_config;
You can’t perform that action at this time.
0 commit comments