diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-28 15:16:22 -0500 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-01-28 15:16:22 -0500 |
commit | a942c1d1686f2af42a8a2f3d59d7e1b5afd0922a (patch) | |
tree | deb42e921e50c12ec9811ce6578ec2bfea7de729 /tpage_test.go | |
parent | Clean up test suite. (diff) | |
download | dedo-a942c1d1686f2af42a8a2f3d59d7e1b5afd0922a.tar.gz dedo-a942c1d1686f2af42a8a2f3d59d7e1b5afd0922a.tar.xz |
Add tpage.put() test.
Diffstat (limited to 'tpage_test.go')
-rw-r--r-- | tpage_test.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tpage_test.go b/tpage_test.go new file mode 100644 index 0000000..d14ebdb --- /dev/null +++ b/tpage_test.go @@ -0,0 +1,35 @@ +package bolt + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// Ensure that a temporary page can insert a key/value. +func TestTpagePut(t *testing.T) { + p := &tpage{nodes: make(tnodes, 0)} + p.put([]byte("baz"), []byte("2")) + p.put([]byte("foo"), []byte("0")) + p.put([]byte("bar"), []byte("1")) + p.put([]byte("foo"), []byte("3")) + assert.Equal(t, len(p.nodes), 3) + assert.Equal(t, p.nodes[0], tnode{[]byte("bar"), []byte("1")}) + assert.Equal(t, p.nodes[1], tnode{[]byte("baz"), []byte("2")}) + assert.Equal(t, p.nodes[2], tnode{[]byte("foo"), []byte("3")}) +} + +// Ensure that a temporary page can deserialize from a page. +func TestTpageRead(t *testing.T) { + t.Skip("pending") +} + +// Ensure that a temporary page can serialize itself. +func TestTpageWrite(t *testing.T) { + t.Skip("pending") +} + +// Ensure that a temporary page can split into appropriate subgroups. +func TestTpageSplit(t *testing.T) { + t.Skip("pending") +} |