Add special type for representing special values
Before this, pseudo-values like lists and containers were represented by
a string leaf value. Now, I can tell these values apart. This can be
helpful for filtering (for example, when printing the values). It will
also be used for implementing key value completion.
Change-Id: I48f6fa2facaf3e8e52aa3b3b4d92130e63acdb6f
diff --git a/tests/datastore_access.cpp b/tests/datastore_access.cpp
index 09801b2..535abdc 100644
--- a/tests/datastore_access.cpp
+++ b/tests/datastore_access.cpp
@@ -207,7 +207,7 @@
// because it'll use the same data structure as libnetconf, so the
// results will be consistent.
#ifdef sysrepo_BACKEND
- {"/example-schema:lol", std::string{"(container)"}},
+ {"/example-schema:lol", special_{SpecialValue::Container}},
#endif
{"/example-schema:up", bool{true}}};
REQUIRE(datastore.getItems("/example-schema:*") == expected);
@@ -240,11 +240,11 @@
datastore.commitChanges();
}
std::map<std::string, leaf_data_> expected{
- {"/example-schema:person[name='Jan']", std::string{"(list)"}},
+ {"/example-schema:person[name='Jan']", special_{SpecialValue::List}},
{"/example-schema:person[name='Jan']/name", std::string{"Jan"}},
- {"/example-schema:person[name='Michal']", std::string{"(list)"}},
+ {"/example-schema:person[name='Michal']", special_{SpecialValue::List}},
{"/example-schema:person[name='Michal']/name", std::string{"Michal"}},
- {"/example-schema:person[name='Petr']", std::string{"(list)"}},
+ {"/example-schema:person[name='Petr']", special_{SpecialValue::List}},
{"/example-schema:person[name='Petr']/name", std::string{"Petr"}}
};