diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-11 09:56:36 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-11 09:56:36 -0700 |
commit | e1e683b97ef11a62692b20bf535815dbf204e13a (patch) | |
tree | c696f61c0e7cf9905bb81ec7a099c22349e6c532 /quick_test.go | |
parent | Merge pull request #20 from benbjohnson/freelist (diff) | |
parent | Cursor iteration. (diff) | |
download | dedo-e1e683b97ef11a62692b20bf535815dbf204e13a.tar.gz dedo-e1e683b97ef11a62692b20bf535815dbf204e13a.tar.xz |
Merge pull request #21 from benbjohnson/cursor
Cursor iteration.
Diffstat (limited to 'quick_test.go')
-rw-r--r-- | quick_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/quick_test.go b/quick_test.go index 4a107a8..3db0b6c 100644 --- a/quick_test.go +++ b/quick_test.go @@ -1,6 +1,7 @@ package bolt import ( + "bytes" "flag" "math/rand" "reflect" @@ -39,6 +40,10 @@ func qconfig() *quick.Config { type testdata []testdataitem +func (t testdata) Len() int { return len(t) } +func (t testdata) Swap(i, j int) { t[i], t[j] = t[j], t[i] } +func (t testdata) Less(i, j int) bool { return bytes.Compare(t[i].Key, t[j].Key) == -1 } + func (t testdata) Generate(rand *rand.Rand, size int) reflect.Value { n := rand.Intn(qmaxitems-1) + 1 items := make(testdata, n) |