aboutsummaryrefslogtreecommitdiff
path: root/quick_test.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-02-20 13:57:26 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-02-20 13:57:26 -0700
commitce3fa8a396927019e75b40b0abaf9cccebf43d69 (patch)
treee146ad3febdb31337327f64bfee272de54fb27d6 /quick_test.go
parentMerge pull request #45 from benbjohnson/seek (diff)
parentBidirectional cursors. (diff)
downloaddedo-ce3fa8a396927019e75b40b0abaf9cccebf43d69.tar.gz
dedo-ce3fa8a396927019e75b40b0abaf9cccebf43d69.tar.xz
Merge pull request #47 from benbjohnson/bidirectional-cursor
Bidirectional cursors
Diffstat (limited to 'quick_test.go')
-rw-r--r--quick_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/quick_test.go b/quick_test.go
index 3db0b6c..cda7b30 100644
--- a/quick_test.go
+++ b/quick_test.go
@@ -55,6 +55,12 @@ func (t testdata) Generate(rand *rand.Rand, size int) reflect.Value {
return reflect.ValueOf(items)
}
+type revtestdata []testdataitem
+
+func (t revtestdata) Len() int { return len(t) }
+func (t revtestdata) Swap(i, j int) { t[i], t[j] = t[j], t[i] }
+func (t revtestdata) Less(i, j int) bool { return bytes.Compare(t[i].Key, t[j].Key) == 1 }
+
type testdataitem struct {
Key []byte
Value []byte