improve test code for trie