diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-09 15:52:19 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-10 14:04:01 -0700 |
commit | 509e93dff4cedf88d91ba2c99385da0b4e41eb6a (patch) | |
tree | b6dc2efd0908df4ca7ff270181e46a1e4d85a77c /meta_test.go | |
parent | Clean up. (diff) | |
download | dedo-509e93dff4cedf88d91ba2c99385da0b4e41eb6a.tar.gz dedo-509e93dff4cedf88d91ba2c99385da0b4e41eb6a.tar.xz |
Add freelist.
Diffstat (limited to 'meta_test.go')
-rw-r--r-- | meta_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/meta_test.go b/meta_test.go new file mode 100644 index 0000000..c082c64 --- /dev/null +++ b/meta_test.go @@ -0,0 +1,18 @@ +package bolt + +import ( + "github.com/stretchr/testify/assert" + "testing" +) + +// Ensure that meta with bad magic is invalid. +func TestMetaValidateMagic(t *testing.T) { + m := &meta{magic: 0x01234567} + assert.Equal(t, m.validate(), InvalidError) +} + +// Ensure that meta with a bad version is invalid. +func TestMetaValidateVersion(t *testing.T) { + m := &meta{magic: magic, version: 200} + assert.Equal(t, m.validate(), VersionMismatchError) +} |