1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Merge pull request #9737 from obsidiansystems/sys-error-split

Separate `SystemError` from `SysError`
This commit is contained in:
John Ericson 2024-01-12 12:41:36 -05:00 committed by GitHub
commit c58da62a06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 59 additions and 27 deletions

View file

@ -73,7 +73,7 @@ namespace nix {
}
TEST(logEI, picksUpSysErrorExitCode) {
TEST(logEI, picksUpSystemErrorExitCode) {
MakeError(TestError, Error);
ErrorInfo::programName = std::optional("error-unit-test");
@ -81,12 +81,12 @@ namespace nix {
try {
auto x = readFile(-1);
}
catch (SysError &e) {
catch (SystemError &e) {
testing::internal::CaptureStderr();
logError(e.info());
auto str = testing::internal::GetCapturedStderr();
ASSERT_STREQ(str.c_str(), "\x1B[31;1merror:\x1B[0m\x1B[34;1m --- SysError --- error-unit-test\x1B[0m\nstatting file: \x1B[33;1mBad file descriptor\x1B[0m\n");
ASSERT_STREQ(str.c_str(), "\x1B[31;1merror:\x1B[0m\x1B[34;1m --- SystemError --- error-unit-test\x1B[0m\nstatting file: \x1B[33;1mBad file descriptor\x1B[0m\n");
}
}