Skip to content

Commit 884304e

Browse files
committed
test: Make system_tests/run_command locale agnostic
1 parent 3db23fd commit 884304e

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/test/system_tests.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,9 @@ BOOST_AUTO_TEST_CASE(run_command)
5151
}
5252
{
5353
// An invalid command is handled by Boost
54-
#ifdef WIN32
55-
const std::string expected{"The system cannot find the file specified."};
56-
#else
57-
const std::string expected{"No such file or directory"};
58-
#endif
5954
BOOST_CHECK_EXCEPTION(RunCommandParseJSON("invalid_command"), boost::process::process_error, [&](const boost::process::process_error& e) {
60-
const std::string what(e.what());
61-
BOOST_CHECK(what.find("RunCommandParseJSON error:") == std::string::npos);
62-
BOOST_CHECK(what.find(expected) != std::string::npos);
55+
BOOST_CHECK(std::string(e.what()).find("RunCommandParseJSON error:") == std::string::npos);
56+
BOOST_CHECK_EQUAL(e.code().value(), 2);
6357
return true;
6458
});
6559
}

0 commit comments

Comments
 (0)