Fix completion bug
The reason why completion didn't work is that the parser didn't reject
"/ietf-system:system-" properly. It was able to parse the
ietf-system:system part but didn't care about the dash. In the end the
parser still failed, but completions did get created as if we were
already inside ietf-system:system (which were not because of the dash).
The fix is this: after a path fragment there can only be two things, a
slash or a "pathEnd" (which is a space or EOI). So, when I parse
ietf-system:system I check if that's the case. Otherwise, the parsing
failed, because we didn't parse the whole path fragment (because of the
dash in this case).
Issue: https://tree.taiga.io/project/jktjkt-netconf-cli/issue/208
Change-Id: I180308658af41e0ae119fcb17c75be9cce6aa764
diff --git a/tests/pretty_printers.hpp b/tests/pretty_printers.hpp
index 7f19a8e..cb9962e 100644
--- a/tests/pretty_printers.hpp
+++ b/tests/pretty_printers.hpp
@@ -181,6 +181,12 @@
return s;
}
+std::ostream& operator<<(std::ostream& s, const cd_& cd)
+{
+ s << "\ncd_ {\n " << cd.m_path << "}\n";
+ return s;
+}
+
std::ostream& operator<<(std::ostream& s, const move_& move)
{
s << "\nmove_ {\n";