--------------- helper functions --------------------------- verify if provided words are present
(t *testing.T, checkWords map[string]bool)
| 129 | |
| 130 | // verify if provided words are present |
| 131 | func (n *Node) verify(t *testing.T, checkWords map[string]bool) { |
| 132 | for k, v := range checkWords { |
| 133 | ok := n.Find(k) |
| 134 | if ok != v { |
| 135 | t.Fatalf( |
| 136 | "%q is %s supposed to be in the Trie.", |
| 137 | k, |
| 138 | map[bool]string{true: "", false: "NOT "}[v], |
| 139 | ) |
| 140 | } |
| 141 | // t.Logf( |
| 142 | // "\"%s\" is %sin the Trie.", |
| 143 | // k, |
| 144 | // map[bool]string{true: "", false: "NOT "}[ok], |
| 145 | // ) |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | // verify expected size and capacity |
| 150 | func (n *Node) verifySizeCapa(t *testing.T, expectedSize, expectedCapacity int) { |
no test coverage detected