aboutsummaryrefslogtreecommitdiff
path: root/db_test.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-02-28 15:13:00 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-02-28 15:13:07 -0700
commit956453b69fd8ba9a356edcf81597d90d769311b2 (patch)
treee6767873d45061d0ca2f4c3f35b235febe2b922e /db_test.go
parentAdd bucket reclamation. (diff)
downloaddedo-956453b69fd8ba9a356edcf81597d90d769311b2.tar.gz
dedo-956453b69fd8ba9a356edcf81597d90d769311b2.tar.xz
Minor refactor.
Diffstat (limited to 'db_test.go')
-rw-r--r--db_test.go7
1 files changed, 7 insertions, 0 deletions
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-")