Merge bitcoin/bitcoin#26377: test: Make system_tests/run_command test locale and platform agnostic
884304e6c6test: Make `system_tests/run_command` locale agnostic (Hennadii Stepanov) Pull request description: Fixes bitcoin/bitcoin#26368. ACKs for top commit: Sjors: tACK884304e6c6Tree-SHA512: 76d4941e02b3b119dcf4dacbe60ef45a9dc8cf775bdb31b5291cd8147665285d41caaf1f5688abdfc9a47c393ddb535af7b11af839660d30ef30f1ca0d936133
This commit is contained in:
1 file changed
+2
-8
@@ -51,15 +51,9 @@ BOOST_AUTO_TEST_CASE(run_command)
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
// An invalid command is handled by Boost
|
// An invalid command is handled by Boost
|
||||||
#ifdef WIN32
|
|
||||||
const std::string expected{"The system cannot find the file specified."};
|
|
||||||
#else
|
|
||||||
const std::string expected{"No such file or directory"};
|
|
||||||
#endif
|
|
||||||
BOOST_CHECK_EXCEPTION(RunCommandParseJSON("invalid_command"), boost::process::process_error, [&](const boost::process::process_error& e) {
|
BOOST_CHECK_EXCEPTION(RunCommandParseJSON("invalid_command"), boost::process::process_error, [&](const boost::process::process_error& e) {
|
||||||
const std::string what(e.what());
|
BOOST_CHECK(std::string(e.what()).find("RunCommandParseJSON error:") == std::string::npos);
|
||||||
BOOST_CHECK(what.find("RunCommandParseJSON error:") == std::string::npos);
|
BOOST_CHECK_EQUAL(e.code().value(), 2);
|
||||||
BOOST_CHECK(what.find(expected) != std::string::npos);
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user