Respect order of subconfigs in znc.conf

This commit is contained in:
njhanley
2020-08-30 18:13:39 -04:00
parent 777c6821d8
commit 926d140a47
3 changed files with 28 additions and 16 deletions
+6 -2
View File
@@ -87,8 +87,7 @@ class CConfigSuccessTest : public CConfigTest {
CConfig::SubConfigMapIterator it2 = conf.BeginSubConfigs();
while (it2 != conf.EndSubConfigs()) {
std::map<CString, CConfigEntry>::const_iterator it3 =
it2->second.begin();
auto it3 = it2->second.begin();
while (it3 != it2->second.end()) {
sRes += "->" + it2->first + "/" + it3->first + "\n";
@@ -146,6 +145,11 @@ TEST_F(CConfigSuccessTest, SubConf8) {
TEST_SUCCESS(" \t <A B>\nfoo = bar\n\tFooO = bar\n</a>",
"->a/B\nfoo=bar\nfooo=bar\n<-\n");
}
// ensure order is preserved i.e. subconfigs should not be sorted by name
TEST_F(CConfigSuccessTest, SubConf9) {
TEST_SUCCESS("<foo b>\n</foo>\n<foo a>\n</foo>",
"->foo/b\n<-\n->foo/a\n<-\n");
}
/* comments */
TEST_F(CConfigSuccessTest, Comment1) {