aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/ErrorTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/ErrorTest.cpp')
-rw-r--r--llvm/unittests/Support/ErrorTest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/unittests/Support/ErrorTest.cpp b/llvm/unittests/Support/ErrorTest.cpp
index 98d19e8..00c562e 100644
--- a/llvm/unittests/Support/ErrorTest.cpp
+++ b/llvm/unittests/Support/ErrorTest.cpp
@@ -976,6 +976,17 @@ TEST(Error, FileErrorTest) {
handleAllErrors(std::move(FE6), [](std::unique_ptr<FileError> F) {
EXPECT_EQ(F->messageWithoutFileInfo(), "CustomError {6}");
});
+
+ Error FE7 =
+ createFileError("file.bin", make_error_code(std::errc::invalid_argument),
+ "invalid argument");
+ EXPECT_EQ(toString(std::move(FE7)), "'file.bin': invalid argument");
+
+ StringRef Argument = "arg";
+ Error FE8 =
+ createFileError("file.bin", make_error_code(std::errc::invalid_argument),
+ "invalid argument '%s'", Argument.str().c_str());
+ EXPECT_EQ(toString(std::move(FE8)), "'file.bin': invalid argument 'arg'");
}
TEST(Error, FileErrorErrorCode) {