aboutsummaryrefslogtreecommitdiff
path: root/meta_test.go
blob: c082c64af15521e99645b90766db6f55b9f137e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)
}