[base] Fixed MemTrie tests.

This commit is contained in:
Yuri Gorshenin 2016-04-27 18:02:05 +03:00
parent 0c7a2491b4
commit f371f2f85b

View file

@ -21,11 +21,12 @@ UNIT_TEST(MemTrie_Basic)
for (auto const & p : data)
trie.Add(p.first, p.second);
vector<pair<string, int>> ordered_data;
trie.ForEach([&ordered_data](string const & k, int v)
vector<pair<string, int>> trie_data;
trie.ForEach([&trie_data](string const & k, int v)
{
ordered_data.emplace_back(k, v);
trie_data.emplace_back(k, v);
});
sort(data.begin(), data.end());
TEST_EQUAL(data, ordered_data, ());
sort(trie_data.begin(), trie_data.end());
TEST_EQUAL(data, trie_data, ());
}