summaryrefslogtreecommitdiffstats
path: root/tests/trie.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-10-10 12:25:30 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-10-10 12:25:30 -0400
commit3b874f45472d6ca3741230875cec3aee5fd0608c (patch)
tree5caa6751b04319c4f0c85835c063f1ae7fea1074 /tests/trie.c
parent39ff273df97e51b1285358b9e6808b117ea8adb1 (diff)
downloadbfs-3b874f45472d6ca3741230875cec3aee5fd0608c.tar.xz
tests/trie: Improve code coverage
Diffstat (limited to 'tests/trie.c')
-rw-r--r--tests/trie.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/trie.c b/tests/trie.c
index 9e9a294..6e6024a 100644
--- a/tests/trie.c
+++ b/tests/trie.c
@@ -20,9 +20,11 @@ static const char *keys[] = {
"quuuux",
"pre",
- "pref",
"prefi",
+ "pref",
"prefix",
+ "p",
+ "pRefix",
"AAAA",
"AADD",
@@ -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;