40 using spair = std::pair<std::string, std::string>;
49 BOOST_REQUIRE_THROW(
parse_kv_pairs(
"=b"), chain::plugin_config_exception);
52 BOOST_REQUIRE_THROW(
parse_kv_pairs(
"a="), chain::plugin_config_exception);
55 BOOST_REQUIRE_THROW(
parse_kv_pairs(
"a"), chain::plugin_config_exception);
58 BOOST_REQUIRE_THROW(
parse_kv_pairs(
""), chain::plugin_config_exception);
64 auto data_dir =
fc::path(bfs::temp_directory_path());
65 auto good_json = std::string(
"{\"version\" : \"test string please ignore\"}");
66 auto good_json_filename = create_temp_file(good_json);
67 auto relative_json_filename = bfs::path(good_json_filename).filename().generic_string();
70 good_abi.version =
"test string please ignore";
72 auto bad_json = std::string(
"{{\"version\":oops\"}");
73 auto bad_json_filename = create_temp_file(bad_json);
74 auto bad_filename = (bfs::temp_directory_path() / bfs::unique_path()).generic_string();
75 auto directory_name = bfs::temp_directory_path().generic_string();
82 BOOST_REQUIRE_THROW(
abi_def_from_file(bad_json_filename, data_dir), chain::json_parse_exception );
83 BOOST_REQUIRE_THROW(
abi_def_from_file(bad_filename, data_dir), chain::plugin_config_exception );
84 BOOST_REQUIRE_THROW(
abi_def_from_file(directory_name, data_dir), chain::plugin_config_exception );