Fix groupings not being properly resolved

Change-Id: I878ea328acd4e01ec5ea2a7d5a28b22350bb11bd
Bug: https://tree.taiga.io/project/jktjkt-netconf-cli/issue/116
Bug: https://tree.taiga.io/project/jktjkt-netconf-cli/issue/95
diff --git a/tests/yang.cpp b/tests/yang.cpp
index f22bbbe..6793250 100644
--- a/tests/yang.cpp
+++ b/tests/yang.cpp
@@ -184,6 +184,28 @@
             type string;
         }
     }
+
+    grouping arithmeticFlags {
+        leaf carry {
+            type boolean;
+        }
+        leaf zero {
+            type boolean;
+        }
+    }
+
+    grouping flags {
+        leaf direction {
+            type boolean;
+        }
+        leaf interrupt {
+            type boolean;
+        }
+
+        uses arithmeticFlags;
+    }
+
+    uses flags;
 })";
 
 TEST_CASE("yangschema")
@@ -232,6 +254,30 @@
                 node.second = "leafa";
             }
 
+            SECTION("example-schema:carry")
+            {
+                node.first = "example-schema";
+                node.second = "carry";
+            }
+
+            SECTION("example-schema:zero")
+            {
+                node.first = "example-schema";
+                node.second = "zero";
+            }
+
+            SECTION("example-schema:direction")
+            {
+                node.first = "example-schema";
+                node.second = "direction";
+            }
+
+            SECTION("example-schema:interrupt")
+            {
+                node.first = "example-schema";
+                node.second = "interrupt";
+            }
+
             REQUIRE(ys.isLeaf(path, node));
         }
         SECTION("isModule")
@@ -531,7 +577,9 @@
                        "example-schema:leafUint", "example-schema:leafEnum", "example-schema:leafEnumTypedef",
                        "example-schema:leafEnumTypedefRestricted", "example-schema:leafEnumTypedefRestricted2",
                        "example-schema:foodIdentLeaf", "example-schema:pizzaIdentLeaf", "example-schema:foodDrinkIdentLeaf",
-                       "example-schema:_list", "example-schema:twoKeyList", "second-schema:bla"};
+                       "example-schema:_list", "example-schema:twoKeyList", "second-schema:bla",
+                       "example-schema:carry", "example-schema:zero", "example-schema:direction",
+                       "example-schema:interrupt"};
             }
 
             SECTION("example-schema:a")
@@ -648,5 +696,25 @@
             }
             REQUIRE_FALSE(ys.leafIdentityIsValid(path, node, value));
         }
+
+        SECTION("grouping is not a node")
+        {
+            SECTION("example-schema:arithmeticFlags")
+            {
+                node.first = "example-schema";
+                node.second = "arithmeticFlags";
+            }
+
+            SECTION("example-schema:flags")
+            {
+                node.first = "example-schema";
+                node.second = "startAndStop";
+            }
+
+            REQUIRE(!ys.isPresenceContainer(path, node));
+            REQUIRE(!ys.isList(path, node));
+            REQUIRE(!ys.isLeaf(path, node));
+            REQUIRE(!ys.isContainer(path, node));
+        }
     }
 }