aboutsummaryrefslogtreecommitdiff
path: root/db_test.go
diff options
context:
space:
mode:
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
+}