From 3b874f45472d6ca3741230875cec3aee5fd0608c Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 10 Oct 2024 12:25:30 -0400 Subject: tests/trie: Improve code coverage --- tests/trie.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3