42832491d0
The Following New Functions have been added 1. AddToCache Adds to the CACHE_LIST map 2. GetFromCache Retrieves path from CACHE_LIST map 3. Rename WriteToCache -> WriteCache() 4. GenerateName now replaces spaces with underscores.
17 lines
353 B
Go
17 lines
353 B
Go
package cache
|
|
|
|
import "testing"
|
|
|
|
func TestLoadCache(t *testing.T) {
|
|
expectedResult := [2]string{"hello/wer.jpg", "hello/iwer.jpg"}
|
|
LoadCache("./testdata/cache.txt")
|
|
var i int = 0
|
|
for _, v := range CACHE_LIST {
|
|
if v != expectedResult[i] {
|
|
if v != expectedResult[i+1] {
|
|
t.Errorf("Didn't Get The Expected Value receieved %s", v)
|
|
}
|
|
}
|
|
}
|
|
}
|