d3ab1579 by astaxie

fix the cache test

1 parent 75d28d49
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
15 package cache 15 package cache
16 16
17 import ( 17 import (
18 "os"
18 "testing" 19 "testing"
19 "time" 20 "time"
20 ) 21 )
...@@ -67,7 +68,7 @@ func TestCache(t *testing.T) { ...@@ -67,7 +68,7 @@ func TestCache(t *testing.T) {
67 } 68 }
68 69
69 func TestFileCache(t *testing.T) { 70 func TestFileCache(t *testing.T) {
70 bm, err := NewCache("file", `{"CachePath":"/cache","FileSuffix":".bin","DirectoryLevel":2,"EmbedExpiry":0}`) 71 bm, err := NewCache("file", `{"CachePath":"cache","FileSuffix":".bin","DirectoryLevel":2,"EmbedExpiry":0}`)
71 if err != nil { 72 if err != nil {
72 t.Error("init err") 73 t.Error("init err")
73 } 74 }
...@@ -112,4 +113,5 @@ func TestFileCache(t *testing.T) { ...@@ -112,4 +113,5 @@ func TestFileCache(t *testing.T) {
112 if v := bm.Get("astaxie"); v.(string) != "author" { 113 if v := bm.Get("astaxie"); v.(string) != "author" {
113 t.Error("get err") 114 t.Error("get err")
114 } 115 }
116 os.RemoveAll("cache")
115 } 117 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!