Fix .. when inside a path with no child nodes

The ".." string was being added to the symbol table on each iteration of
availableNodes. That means, if there were no child nodes in the current
context path (the one stored in Parser), no ".." was added, so you
couldn't go up. It was also somewhat inefficient to add it on each
iteration.

Change-Id: If9e17a545bd175843d8d0a8897ffeb74c07de0c7
diff --git a/tests/ls.cpp b/tests/ls.cpp
index 83b2d8d..0a91dfb 100644
--- a/tests/ls.cpp
+++ b/tests/ls.cpp
@@ -77,6 +77,18 @@
                 expected.m_path = dataPath_{Scope::Absolute, {}};
             }
 
+            SECTION("going up from a node with no children")
+            {
+                parser.changeNode(dataPath_{Scope::Relative, {dataNode_(module_{"second"}, container_{"a"})}});
+                REQUIRE(schema->availableNodes(parser.currentPath(), Recursion::NonRecursive) == std::set<ModuleNodePair>{});
+                input = "ls ../example:a";
+                expected.m_path = dataPath_{Scope::Relative, {
+                    dataNode_{nodeup_{}},
+                    dataNode_{module_{"example"}, container_{"a"}}
+                }};
+
+            }
+
             SECTION("ls example:a/a2")
             {
                 input = "ls example:a/a2";