Ensure that a page with the minimum number of inodes just returns a single node.
(t *testing.T)
| 135 | |
| 136 | // Ensure that a page with the minimum number of inodes just returns a single node. |
| 137 | func TestNode_split_MinKeys(t *testing.T) { |
| 138 | // Create a node. |
| 139 | m := &common.Meta{} |
| 140 | m.SetPgid(1) |
| 141 | n := &node{inodes: make(common.Inodes, 0), bucket: &Bucket{tx: &Tx{db: &DB{}, meta: m}}} |
| 142 | n.put([]byte("00000001"), []byte("00000001"), []byte("0123456701234567"), 0, 0) |
| 143 | n.put([]byte("00000002"), []byte("00000002"), []byte("0123456701234567"), 0, 0) |
| 144 | |
| 145 | // Split. |
| 146 | n.split(20) |
| 147 | if n.parent != nil { |
| 148 | t.Fatalf("expected nil parent") |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | // Ensure that a node that has keys that all fit on a page just returns one leaf. |
| 153 | func TestNode_split_SinglePage(t *testing.T) { |