diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-10-24 13:36:04 +0100 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-10-24 13:36:04 +0100 |
commit | 884304e6c6a250719a64752fe52d1283cd5e36ab (patch) | |
tree | a12a513294766ca9412edf1893f32e0742c740c4 | |
parent | 3db23fd821e0a08e246a60c198676be42de5bcd6 (diff) |
test: Make `system_tests/run_command` locale agnostic
-rw-r--r-- | src/test/system_tests.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/test/system_tests.cpp b/src/test/system_tests.cpp index 11f4be7fef..d5b65b9c08 100644 --- a/src/test/system_tests.cpp +++ b/src/test/system_tests.cpp @@ -51,15 +51,9 @@ BOOST_AUTO_TEST_CASE(run_command) } { // 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) { - const std::string what(e.what()); - BOOST_CHECK(what.find("RunCommandParseJSON error:") == std::string::npos); - BOOST_CHECK(what.find(expected) != std::string::npos); + BOOST_CHECK(std::string(e.what()).find("RunCommandParseJSON error:") == std::string::npos); + BOOST_CHECK_EQUAL(e.code().value(), 2); return true; }); } |