Fix a bug with path completion
When creating suggestions through the dataPathListEnd rule,
this position saved to the m_completionIterator was wrong. For example,
when completing this command:
set example:list
the completion iterator would get set just before "list". Now it
correctly sets it just before "example". This bug was not caught by
tests because tests only use cd and the rule for that command never uses
the dataPathListEnd rule.
Change-Id: Ie2f94c26e9d600ebf8246aa97ed7045b4eea6faa
diff --git a/tests/path_completion.cpp b/tests/path_completion.cpp
index 462a2e6..0359675 100644
--- a/tests/path_completion.cpp
+++ b/tests/path_completion.cpp
@@ -110,6 +110,12 @@
expected = {"example:list"};
}
+ SECTION("set example:list")
+ {
+ input = "set example:list";
+ expected = {"example:list"};
+ }
+
SECTION("cd example:list[")
{
input = "cd example:list[";