fix travis-ci
diff --git a/.travis.yml b/.travis.yml
index 65d1305..8288a4c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,6 +3,7 @@
go:
- 1.2
- 1.3
+ - 1.4
- tip
-script: go test ./...
\ No newline at end of file
+script: go test -timeout 1h ./...
diff --git a/leveldb/go13_bench_test.go b/leveldb/bench2_test.go
similarity index 98%
rename from leveldb/go13_bench_test.go
rename to leveldb/bench2_test.go
index e76657e..0dd60fd 100644
--- a/leveldb/go13_bench_test.go
+++ b/leveldb/bench2_test.go
@@ -4,7 +4,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// +build go1.3
+// +build !go1.2
package leveldb
diff --git a/leveldb/cache/bench2_test.go b/leveldb/cache/bench2_test.go
new file mode 100644
index 0000000..175e222
--- /dev/null
+++ b/leveldb/cache/bench2_test.go
@@ -0,0 +1,30 @@
+// Copyright (c) 2012, Suryandaru Triandana <syndtr@gmail.com>
+// All rights reserved.
+//
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// +build !go1.2
+
+package cache
+
+import (
+ "math/rand"
+ "testing"
+)
+
+func BenchmarkLRUCache(b *testing.B) {
+ c := NewCache(NewLRU(10000))
+
+ b.SetParallelism(10)
+ b.RunParallel(func(pb *testing.PB) {
+ r := rand.New(rand.NewSource(time.Now().UnixNano()))
+
+ for pb.Next() {
+ key := uint64(r.Intn(1000000))
+ c.Get(0, key, func() (int, Value) {
+ return 1, key
+ }).Release()
+ }
+ })
+}
diff --git a/leveldb/cache/cache_test.go b/leveldb/cache/cache_test.go
index 5575583..c2a5015 100644
--- a/leveldb/cache/cache_test.go
+++ b/leveldb/cache/cache_test.go
@@ -552,19 +552,3 @@
t.Errorf("delFunc isn't called 1 times: got=%d", delFuncCalled)
}
}
-
-func BenchmarkLRUCache(b *testing.B) {
- c := NewCache(NewLRU(10000))
-
- b.SetParallelism(10)
- b.RunParallel(func(pb *testing.PB) {
- r := rand.New(rand.NewSource(time.Now().UnixNano()))
-
- for pb.Next() {
- key := uint64(r.Intn(1000000))
- c.Get(0, key, func() (int, Value) {
- return 1, key
- }).Release()
- }
- })
-}