From c3903d38a10fda3c9a366d62705e06ddc558eb2d Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Mon, 5 May 2014 07:56:54 -0600 Subject: Consolidate code for clarity. This commit consolidates some of the smaller files into some of the larger files. The smaller files cluttered the file tree and made it harder to see the logical groupings of structs. --- db_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'db_test.go') diff --git a/db_test.go b/db_test.go index d0933e8..b7e2a2f 100644 --- a/db_test.go +++ b/db_test.go @@ -353,6 +353,18 @@ func TestDBStats_Sub(t *testing.T) { assert.Equal(t, 7, diff.TxStats.PageCount) } +// Ensure that meta with bad magic is invalid. +func TestMeta_validate_magic(t *testing.T) { + m := &meta{magic: 0x01234567} + assert.Equal(t, m.validate(), ErrInvalid) +} + +// Ensure that meta with a bad version is invalid. +func TestMeta_validate_version(t *testing.T) { + m := &meta{magic: magic, version: 200} + assert.Equal(t, m.validate(), ErrVersionMismatch) +} + func ExampleDB_Update() { // Open the database. db, _ := Open(tempfile(), 0666) -- cgit v1.2.3