aboutsummaryrefslogtreecommitdiff
path: root/db_test.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-02-15 22:09:35 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-02-15 22:09:35 -0700
commit3f0daf11ca5f232baa9a891b4301822d2b0cbeeb (patch)
tree057b2bf9d7487343f477f62726919421dc66b6b6 /db_test.go
parentMerge pull request #32 from benbjohnson/blocks (diff)
parentAdd parallel usage test and race detector. (diff)
downloaddedo-3f0daf11ca5f232baa9a891b4301822d2b0cbeeb.tar.gz
dedo-3f0daf11ca5f232baa9a891b4301822d2b0cbeeb.tar.xz
Merge pull request #34 from benbjohnson/multithreading
Race Detection
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 1a9aa02..666ba4a 100644
--- a/db_test.go
+++ b/db_test.go
@@ -259,3 +259,10 @@ func withOpenDB(fn func(*DB, string)) {
fn(db, path)
})
}
+
+func trunc(b []byte, length int) []byte {
+ if length < len(b) {
+ return b[:length]
+ }
+ return b
+}