Skip to content

Commit

Permalink
tests/trie: Improve code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
tavianator committed Oct 10, 2024
1 parent 39ff273 commit 3b874f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ static const char *keys[] = {
"quuuux",

"pre",
"pref",
"prefi",
"pref",
"prefix",
"p",
"pRefix",

"AAAA",
"AADD",
Expand Down Expand Up @@ -75,6 +77,7 @@ void check_trie(void) {
size_t i = 0;
for_trie (leaf, &trie) {
bfs_check(leaf == trie_find_str(&trie, keys[i]));
bfs_check(leaf == trie_insert_str(&trie, keys[i]));
bfs_check(!leaf->prev || leaf->prev->next == leaf);
bfs_check(!leaf->next || leaf->next->prev == leaf);
++i;
Expand Down

0 comments on commit 3b874f4

Please sign in to comment.