diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-20 13:57:26 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-20 13:57:26 -0700 |
commit | ce3fa8a396927019e75b40b0abaf9cccebf43d69 (patch) | |
tree | e146ad3febdb31337327f64bfee272de54fb27d6 /quick_test.go | |
parent | Merge pull request #45 from benbjohnson/seek (diff) | |
parent | Bidirectional cursors. (diff) | |
download | dedo-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.go | 6 |
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 |