Skip to content

Commit

Permalink
Add a couple more test patterns.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg7mdp committed Jun 23, 2023
1 parent f1eb13a commit 05fe45a
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions unittests/abi_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2010,7 +2010,6 @@ BOOST_AUTO_TEST_CASE(abi_std_optional)
std::string test_data = R"=====(
{
"gas_price" : "42",
"miner_cut" : "2",
"bridge_fee" : "2"
}
)=====";
Expand All @@ -2019,7 +2018,29 @@ BOOST_AUTO_TEST_CASE(abi_std_optional)
verify_byte_round_trip_conversion(abis, "fees", var);
}


{
// check conversion when all optional members are provided
std::string test_data = R"=====(
{
"gas_price" : "42",
"miner_cut" : "2",
}
)=====";

auto var = fc::json::from_string(test_data);
verify_byte_round_trip_conversion(abis, "fees", var);
}

{
// check conversion when all optional members are provided
std::string test_data = R"=====(
{
}
)=====";

auto var = fc::json::from_string(test_data);
verify_byte_round_trip_conversion(abis, "fees", var);
}

} FC_LOG_AND_RETHROW() }

Expand Down

0 comments on commit 05fe45a

Please sign in to comment.