MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / verify

Method verify

structure/trie/trie_test.go:131–147  ·  view source on GitHub ↗

--------------- helper functions --------------------------- verify if provided words are present

(t *testing.T, checkWords map[string]bool)

Source from the content-addressed store, hash-verified

129
130// verify if provided words are present
131func (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
150func (n *Node) verifySizeCapa(t *testing.T, expectedSize, expectedCapacity int) {

Callers 3

TestTrieInsertFunction · 0.95
TestTrieRemoveFunction · 0.95

Calls 1

FindMethod · 0.95

Tested by

no test coverage detected