YANGTOOLS-706: Split out yang-parser-rfc7950
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / resources / rfc7950 / list-keys-test / correct-list-keys-test.yang
diff --git a/yang/yang-parser-rfc7950/src/test/resources/rfc7950/list-keys-test/correct-list-keys-test.yang b/yang/yang-parser-rfc7950/src/test/resources/rfc7950/list-keys-test/correct-list-keys-test.yang
new file mode 100644 (file)
index 0000000..d5b894e
--- /dev/null
@@ -0,0 +1,45 @@
+module correct-list-keys-test {
+    yang-version 1;
+    namespace "correct-list-keys-test";
+    prefix "test";
+
+    list valid-list-a {
+        leaf a1 {
+            type string;
+        }
+        leaf a2 {
+            when "../a1 = 'key-a1'";
+            type int32;
+        }
+        key "a1 test:a2";
+    }
+
+    list valid-list-b {
+        key "b";
+        leaf b {
+            if-feature feature-b;
+            type string;
+        }
+    }
+
+    grouping d {
+        leaf d1 {
+            type int32;
+            if-feature feature-d;
+        }
+        leaf d2 {
+            when "../d1 = '2'";
+            type string;
+        }
+    }
+
+    list valid-list-d1 {
+        key d1;
+        uses d;
+    }
+
+    list valid-list-d2 {
+        key test:d2;
+        uses d;
+    }
+}