fix save and recovery

This commit is contained in:
Xiang Li
2013-11-04 21:51:14 -08:00
parent 0d8510df33
commit 07b52ee24c
4 changed files with 43 additions and 38 deletions

View File

@ -1,14 +1,13 @@
package store
import (
"container/heap"
"fmt"
"testing"
"time"
)
func TestHeapPushPop(t *testing.T) {
h := newTTLKeyHeap()
h := newTtlKeyHeap()
// add from older expire time to earlier expire time
// the path is equal to ttl from now
@ -32,8 +31,7 @@ func TestHeapPushPop(t *testing.T) {
}
func TestHeapUpdate(t *testing.T) {
h := &TTLKeyHeap{Map: make(map[*Node]int)}
heap.Init(h)
h := newTtlKeyHeap()
kvs := make([]*Node, 10)