Fix cd into leafs
Issue: https://tree.taiga.io/project/jktjkt-netconf-cli/issue/173
Change-Id: I553c6d769204ebadc3625b9a3fc397adb64ca484
diff --git a/tests/cd.cpp b/tests/cd.cpp
index 174ffd0..3e29d5a 100644
--- a/tests/cd.cpp
+++ b/tests/cd.cpp
@@ -33,6 +33,7 @@
schema->addRpc("/", "example:launch-nukes");
schema->addList("/", "example:ports", {"name"});
schema->addLeaf("/example:ports", "example:name", createEnum({"A", "B", "C"}));
+ schema->addLeaf("/", "example:myLeaf", yang::Int32{});
Parser parser(schema);
std::string input;
std::ostringstream errorStream;
@@ -330,6 +331,11 @@
input = "cd example:launch-nukes";
}
+ SECTION("cd into a leaf")
+ {
+ input = "cd example:myLeaf";
+ }
+
REQUIRE_THROWS_AS(parser.parseCommand(input, errorStream), InvalidCommandException);
}
}