From 956453b69fd8ba9a356edcf81597d90d769311b2 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Fri, 28 Feb 2014 15:13:00 -0700 Subject: Minor refactor. --- db_test.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'db_test.go') diff --git a/db_test.go b/db_test.go index 59f8748..2b7975c 100644 --- a/db_test.go +++ b/db_test.go @@ -334,6 +334,13 @@ func TestDBMmapSize(t *testing.T) { assert.Equal(t, db.mmapSize(1<<30), 1<<31) } +// Ensure that a database can return a string representation of itself. +func TestDBString(t *testing.T) { + db := &DB{path: "/tmp/foo"} + assert.Equal(t, db.String(), `DB<"/tmp/foo">`) + assert.Equal(t, db.GoString(), `bolt.DB{path:"/tmp/foo"}`) +} + // withDB executes a function with a database reference. func withDB(fn func(*DB, string)) { f, _ := ioutil.TempFile("", "bolt-") -- cgit v1.2.3