From 15e0eae829433f645c0d1f93333292f8b996c9c4 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Thu, 20 Feb 2014 13:53:40 -0700 Subject: Bidirectional cursors. --- quick_test.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'quick_test.go') 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 -- cgit v1.2.3