handling of unique
Change-Id: Iadd216f2c8ada19a3b3c11a670497d1a493b8237
diff --git a/compiler/base/parser/src/test/resources/UniqueDescendent.yang b/compiler/base/parser/src/test/resources/UniqueDescendent.yang
new file mode 100644
index 0000000..20409cb
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UniqueDescendent.yang
@@ -0,0 +1,12 @@
+module TestDescendent {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Ant;
+ list networks {
+ key "abc";
+ unique "/abc";
+ leaf abc {
+ type "String";
+ }
+ }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/UniqueError.yang b/compiler/base/parser/src/test/resources/UniqueError.yang
new file mode 100644
index 0000000..cd15de1
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UniqueError.yang
@@ -0,0 +1,20 @@
+module TestUnique {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Anim;
+ list resources {
+ key "count";
+ leaf count {
+ type int;
+ }
+ unique "animal/mammal/abc";
+ container animal {
+ list mammal {
+ key "abc";
+ leaf abc {
+ type "String";
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/WrongHolderOfUnique.yang b/compiler/base/parser/src/test/resources/WrongHolderOfUnique.yang
new file mode 100644
index 0000000..b259cc1
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/WrongHolderOfUnique.yang
@@ -0,0 +1,11 @@
+module TestHolder {
+ yang-version 1;
+ namespace http://huawei.com;
+ prefix Hold;
+ container birds {
+ unique "abc"
+ leaf abc {
+ type "String";
+ }
+ }
+}
\ No newline at end of file