summaryrefslogtreecommitdiff
path: root/AK/Tests
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-12-26 14:43:27 +0330
committerAndreas Kling <kling@serenityos.org>2020-12-26 12:32:27 +0100
commit1c9d28d212e31060b9fb34107c7d608cb6cade02 (patch)
tree477ca926841ca63086638973e56ea1f8c054fa11 /AK/Tests
parentad646420dd25bff4532faed3f4919168df01144c (diff)
downloadserenity-1c9d28d212e31060b9fb34107c7d608cb6cade02.zip
AK: Fix busted Trie test
This wasn't testing anything ^^'
Diffstat (limited to 'AK/Tests')
-rw-r--r--AK/Tests/TestTrie.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/AK/Tests/TestTrie.cpp b/AK/Tests/TestTrie.cpp
index cae1b5b63f..853b9ff18a 100644
--- a/AK/Tests/TestTrie.cpp
+++ b/AK/Tests/TestTrie.cpp
@@ -71,10 +71,17 @@ TEST_CASE(iterate)
for (size_t i = 0; i < input.size(); ++i)
input[i] = i;
+ bunch_of_numbers.insert(input.begin(), input.end());
+
// Iteration order is preorder (order between adjacent nodes is not defined, but parents come before children)
// in this case, the tree is linear.
size_t i = 0;
+ bool is_root = true;
for (auto& node : bunch_of_numbers) {
+ if (is_root) {
+ is_root = false;
+ continue;
+ }
EXPECT_EQ(input[i], node.value());
++i;
}