mirror of
https://github.com/woodchen-ink/webp_server_go.git
synced 2025-07-18 05:32:02 +08:00
26 lines
485 B
Go
26 lines
485 B
Go
// webp_server_go - prefetch_test.go
|
|
// 2020-11-10 09:27
|
|
// Benny <benny.think@gmail.com>
|
|
|
|
package main
|
|
|
|
import (
|
|
"github.com/stretchr/testify/assert"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestPrefetchImages(t *testing.T) {
|
|
fp := "./prefetch"
|
|
_ = os.Mkdir(fp, 0755)
|
|
prefetchImages("./pics/dir1/", "./prefetch")
|
|
count := fileCount("./prefetch")
|
|
assert.Equal(t, int64(1), count)
|
|
_ = os.RemoveAll(fp)
|
|
}
|
|
|
|
func TestBadPrefetch(t *testing.T) {
|
|
jobs = 1
|
|
prefetchImages("./pics2", "./prefetch")
|
|
}
|