diff options
author | David Blaikie <dblaikie@gmail.com> | 2021-09-08 16:03:28 -0700 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2021-09-08 16:16:54 -0700 |
commit | 0c502507f4627f72eeecbb5e78c2f9c1cb8f9219 (patch) | |
tree | 423d77ca4be2aa2f19bb3d36c24859ca34de7e95 /llvm/unittests/Support/ErrorTest.cpp | |
parent | a024d35b3885490221e78b835b087a830cc3c325 (diff) | |
download | llvm-0c502507f4627f72eeecbb5e78c2f9c1cb8f9219.zip llvm-0c502507f4627f72eeecbb5e78c2f9c1cb8f9219.tar.gz llvm-0c502507f4627f72eeecbb5e78c2f9c1cb8f9219.tar.bz2 |
FileError: Support zero-length file names
It's a common error in an API - to try to open an empty file, so it
seems like a reasonable FileError to produce "hey, you tried to open an
empty file" and to handle it the same way as any other file error.
Diffstat (limited to 'llvm/unittests/Support/ErrorTest.cpp')
-rw-r--r-- | llvm/unittests/Support/ErrorTest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/unittests/Support/ErrorTest.cpp b/llvm/unittests/Support/ErrorTest.cpp index d9e86fdd..9356402 100644 --- a/llvm/unittests/Support/ErrorTest.cpp +++ b/llvm/unittests/Support/ErrorTest.cpp @@ -957,6 +957,9 @@ TEST(Error, FileErrorTest) { .compare("'file.bin': CustomError {41}\n" "'file2.bin': CustomError {42}"), 0); + + Error FE5 = createFileError("", make_error<CustomError>(1)); + EXPECT_EQ(toString(std::move(FE5)).compare("'': CustomError {1}"), 0); } enum class test_error_code { |