tree schema BUGFIX correct predicate order in lysc_path (#2244)
* tree schema BUGFIX correct predicate order in lysc_path
* correct uncrustify errors
* test non-empty path after predicates
---------
Co-authored-by: Alexandre Snarskii <snar@retn.net>
diff --git a/tests/utests/schema/test_schema.c b/tests/utests/schema/test_schema.c
index 5cb5e47..2dd7f6d 100644
--- a/tests/utests/schema/test_schema.c
+++ b/tests/utests/schema/test_schema.c
@@ -1873,6 +1873,7 @@
" leaf k {type string;}"
" leaf l {type string;}"
" leaf m {type string;}"
+ " leaf n {type string;}"
" }"
"}}", LYS_IN_YANG, NULL));
@@ -1880,6 +1881,10 @@
path = lysc_path(node, LYSC_PATH_DATA_PATTERN, NULL, 0);
assert_string_equal(path, "/b:a/l[k='%s'][l='%s'][m='%s']");
free(path);
+ node = lys_find_path(UTEST_LYCTX, NULL, "/b:a/l/n", 0);
+ path = lysc_path(node, LYSC_PATH_DATA_PATTERN, NULL, 0);
+ assert_string_equal(path, "/b:a/l[k='%s'][l='%s'][m='%s']/n");
+ free(path);
}
int