diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-28 15:13:00 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-28 15:13:07 -0700 |
commit | 956453b69fd8ba9a356edcf81597d90d769311b2 (patch) | |
tree | e6767873d45061d0ca2f4c3f35b235febe2b922e /db_test.go | |
parent | Add bucket reclamation. (diff) | |
download | dedo-956453b69fd8ba9a356edcf81597d90d769311b2.tar.gz dedo-956453b69fd8ba9a356edcf81597d90d769311b2.tar.xz |
Minor refactor.
Diffstat (limited to 'db_test.go')
-rw-r--r-- | db_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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-") |