Add leafrefPath(const std::string&)

Will be useful in the upcoming describe command.

Change-Id: I480b93491f98c23eab6498503ca07d6b7c9c8e4f
diff --git a/tests/yang.cpp b/tests/yang.cpp
index 5f2f0c3..c5f6fa4 100644
--- a/tests/yang.cpp
+++ b/tests/yang.cpp
@@ -290,6 +290,12 @@
         units "vt";
     }
 
+    leaf activeNumber {
+        type leafref {
+            path "/_list/number";
+        }
+    }
+
 })";
 
 namespace std {
@@ -756,7 +762,8 @@
                        "example-schema:ethernet", "example-schema:loopback",
                        "example-schema:pizzaSize",
                        "example-schema:length", "example-schema:wavelength",
-                       "example-schema:duration", "example-schema:another-duration"};
+                       "example-schema:duration", "example-schema:another-duration",
+                       "example-schema:activeNumber"};
             }
 
             SECTION("example-schema:a")
@@ -894,6 +901,11 @@
 
             REQUIRE(ys.nodeType(pathToSchemaString(path, Prefixes::WhenNeeded)) == expected);
         }
+
+        SECTION("leafrefPath")
+        {
+            REQUIRE(ys.leafrefPath("/example-schema:activeNumber") == "/example-schema:_list/number");
+        }
     }
 
     SECTION("negative")