@@ -552,7 +552,7 @@ BOOST_AUTO_TEST_CASE(help_example)
552
552
// test different argument types
553
553
const RPCArgList& args = {{" foo" , " bar" }, {" b" , true }, {" n" , 1 }};
554
554
BOOST_CHECK_EQUAL (HelpExampleCliNamed (" test" , args), " > bitcoin-cli -named test foo=bar b=true n=1\n " );
555
- BOOST_CHECK_EQUAL (HelpExampleRpcNamed (" test" , args), " > curl --user myusername --data-binary '{\" jsonrpc\" : \" 2.0\" , \" id\" : \" curltest\" , \" method\" : \" test\" , \" params\" : {\" foo\" :\" bar\" ,\" b\" :true,\" n\" :1}}' -H 'content-type: text/plain ;' http://127.0.0.1:8332/\n " );
555
+ BOOST_CHECK_EQUAL (HelpExampleRpcNamed (" test" , args), " > curl --user myusername --data-binary '{\" jsonrpc\" : \" 2.0\" , \" id\" : \" curltest\" , \" method\" : \" test\" , \" params\" : {\" foo\" :\" bar\" ,\" b\" :true,\" n\" :1}}' -H 'content-type: application/json ;' http://127.0.0.1:8332/\n " );
556
556
557
557
// test shell escape
558
558
BOOST_CHECK_EQUAL (HelpExampleCliNamed (" test" , {{" foo" , " b'ar" }}), " > bitcoin-cli -named test foo='b'''ar'\n " );
@@ -565,15 +565,15 @@ BOOST_AUTO_TEST_CASE(help_example)
565
565
obj_value.pushKV (" b" , false );
566
566
obj_value.pushKV (" n" , 1 );
567
567
BOOST_CHECK_EQUAL (HelpExampleCliNamed (" test" , {{" name" , obj_value}}), " > bitcoin-cli -named test name='{\" foo\" :\" bar\" ,\" b\" :false,\" n\" :1}'\n " );
568
- BOOST_CHECK_EQUAL (HelpExampleRpcNamed (" test" , {{" name" , obj_value}}), " > curl --user myusername --data-binary '{\" jsonrpc\" : \" 2.0\" , \" id\" : \" curltest\" , \" method\" : \" test\" , \" params\" : {\" name\" :{\" foo\" :\" bar\" ,\" b\" :false,\" n\" :1}}}' -H 'content-type: text/plain ;' http://127.0.0.1:8332/\n " );
568
+ BOOST_CHECK_EQUAL (HelpExampleRpcNamed (" test" , {{" name" , obj_value}}), " > curl --user myusername --data-binary '{\" jsonrpc\" : \" 2.0\" , \" id\" : \" curltest\" , \" method\" : \" test\" , \" params\" : {\" name\" :{\" foo\" :\" bar\" ,\" b\" :false,\" n\" :1}}}' -H 'content-type: application/json ;' http://127.0.0.1:8332/\n " );
569
569
570
570
// test array params
571
571
UniValue arr_value (UniValue::VARR);
572
572
arr_value.push_back (" bar" );
573
573
arr_value.push_back (false );
574
574
arr_value.push_back (1 );
575
575
BOOST_CHECK_EQUAL (HelpExampleCliNamed (" test" , {{" name" , arr_value}}), " > bitcoin-cli -named test name='[\" bar\" ,false,1]'\n " );
576
- BOOST_CHECK_EQUAL (HelpExampleRpcNamed (" test" , {{" name" , arr_value}}), " > curl --user myusername --data-binary '{\" jsonrpc\" : \" 2.0\" , \" id\" : \" curltest\" , \" method\" : \" test\" , \" params\" : {\" name\" :[\" bar\" ,false,1]}}' -H 'content-type: text/plain ;' http://127.0.0.1:8332/\n " );
576
+ BOOST_CHECK_EQUAL (HelpExampleRpcNamed (" test" , {{" name" , arr_value}}), " > curl --user myusername --data-binary '{\" jsonrpc\" : \" 2.0\" , \" id\" : \" curltest\" , \" method\" : \" test\" , \" params\" : {\" name\" :[\" bar\" ,false,1]}}' -H 'content-type: application/json ;' http://127.0.0.1:8332/\n " );
577
577
578
578
// test types don't matter for shell
579
579
BOOST_CHECK_EQUAL (HelpExampleCliNamed (" foo" , {{" arg" , true }}), HelpExampleCliNamed (" foo" , {{" arg" , " true" }}));
0 commit comments