diff --git a/lldb/unittests/Interpreter/TestCompletion.cpp b/lldb/unittests/Interpreter/TestCompletion.cpp index 38cae056a197..bb3d24d927cf 100644 --- a/lldb/unittests/Interpreter/TestCompletion.cpp +++ b/lldb/unittests/Interpreter/TestCompletion.cpp @@ -163,6 +163,9 @@ TEST_F(CompletionTest, DirCompletionAbsolute) { // When a directory is specified that doesn't end in a slash, it searches // for that directory, not items under it. + // Sanity check that the path we complete on exists and isn't too long. + ASSERT_TRUE(llvm::sys::fs::exists(BaseDir)); + ASSERT_LE(BaseDir.size(), static_cast(PATH_MAX)); size_t Count = CommandCompletions::DiskDirectories(BaseDir, Results, Resolver); ASSERT_EQ(1u, Count);