diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-10 16:58:16 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-10 16:58:16 -0700 |
commit | a68bd301db09ef5465f12ff4242696799da5b14d (patch) | |
tree | b6dc2efd0908df4ca7ff270181e46a1e4d85a77c /page_test.go | |
parent | Clean up. (diff) | |
parent | Add freelist. (diff) | |
download | dedo-a68bd301db09ef5465f12ff4242696799da5b14d.tar.gz dedo-a68bd301db09ef5465f12ff4242696799da5b14d.tar.xz |
Merge pull request #20 from benbjohnson/freelist
Freelist
Diffstat (limited to 'page_test.go')
-rw-r--r-- | page_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/page_test.go b/page_test.go new file mode 100644 index 0000000..05b0509 --- /dev/null +++ b/page_test.go @@ -0,0 +1,21 @@ +package bolt + +import ( + "github.com/stretchr/testify/assert" + "testing" +) + +// Ensure that the page type can be returned in human readable format. +func TestPageTyp(t *testing.T) { + assert.Equal(t, (&page{flags: p_branch}).typ(), "branch") + assert.Equal(t, (&page{flags: p_leaf}).typ(), "leaf") + assert.Equal(t, (&page{flags: p_meta}).typ(), "meta") + assert.Equal(t, (&page{flags: p_buckets}).typ(), "buckets") + assert.Equal(t, (&page{flags: p_freelist}).typ(), "freelist") + assert.Equal(t, (&page{flags: 20000}).typ(), "unknown<4e20>") +} + +// Ensure that the hexdump debugging function doesn't blow up. +func TestPageDump(t *testing.T) { + (&page{id: 256}).hexdump(16) +} |