port trie's tests from old version