newTestNode creates a new node with the given key, value, left and right child keys
(k string, value []byte, leftChildKey, rightChildKey string)
| 2066 | |
| 2067 | // newTestNode creates a new node with the given key, value, left and right child keys |
| 2068 | func newTestNode(k string, value []byte, leftChildKey, rightChildKey string) *node { |
| 2069 | // create the key bytes for the left child |
| 2070 | leftKey := keyBytesFromStr(leftChildKey) |
| 2071 | // create the key bytes for the right child |
| 2072 | rightKey := keyBytesFromStr(rightChildKey) |
| 2073 | // create the node |
| 2074 | return &node{ |
| 2075 | Key: &key{ |
| 2076 | key: keyBytesFromStr(k), |
| 2077 | }, |
| 2078 | Node: lib.Node{ |
| 2079 | Value: value, |
| 2080 | LeftChildKey: leftKey, |
| 2081 | RightChildKey: rightKey, |
| 2082 | }, |
| 2083 | } |
| 2084 | } |
| 2085 | |
| 2086 | // keyBytesFromStr converts a string of binary bits to a byte slice |
| 2087 | // CONTRACT: str must be < than 8 bits |
no test coverage detected