diff options
Diffstat (limited to 'lldb/unittests/Utility/CompletionRequestTest.cpp')
-rw-r--r-- | lldb/unittests/Utility/CompletionRequestTest.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lldb/unittests/Utility/CompletionRequestTest.cpp b/lldb/unittests/Utility/CompletionRequestTest.cpp index b5dff350eae..134bf517f85 100644 --- a/lldb/unittests/Utility/CompletionRequestTest.cpp +++ b/lldb/unittests/Utility/CompletionRequestTest.cpp @@ -13,18 +13,16 @@ using namespace lldb_private; TEST(CompletionRequest, Constructor) { - std::string command = "a b"; - const unsigned cursor_pos = 2; - Args args(command); + std::string command = "a bad c"; + const unsigned cursor_pos = 3; const int arg_index = 1; - const int arg_cursor_pos = 0; + const int arg_cursor_pos = 1; const int match_start = 2345; const int match_max_return = 12345; - bool word_complete = false; StringList matches; - CompletionRequest request(command, cursor_pos, args, arg_index, - arg_cursor_pos, match_start, match_max_return, - word_complete, matches); + + CompletionRequest request(command, cursor_pos, match_start, match_max_return, + matches); EXPECT_STREQ(request.GetRawLine().str().c_str(), command.c_str()); EXPECT_EQ(request.GetRawCursorPos(), cursor_pos); @@ -32,7 +30,11 @@ TEST(CompletionRequest, Constructor) { EXPECT_EQ(request.GetCursorCharPosition(), arg_cursor_pos); EXPECT_EQ(request.GetMatchStartPoint(), match_start); EXPECT_EQ(request.GetMaxReturnElements(), match_max_return); - EXPECT_EQ(request.GetWordComplete(), word_complete); + EXPECT_EQ(request.GetWordComplete(), false); + + EXPECT_EQ(request.GetPartialParsedLine().GetArgumentCount(), 2u); + EXPECT_STREQ(request.GetPartialParsedLine().GetArgumentAtIndex(1), "b"); + // This is the generated matches should be equal to our passed string list. EXPECT_EQ(&request.GetMatches(), &matches); } |