Add null-check for trie_search
Rewrite test with minitest/unit