1 Star 1 Fork 1

caixw / blogit

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
blogit_test.go 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
caixw 提交于 2021-11-27 15:37 . chore: 更新依赖项
// SPDX-License-Identifier: MIT
package blogit
import (
"testing"
"github.com/issue9/assert/v2"
"github.com/issue9/version"
"github.com/caixw/blogit/v2/internal/filesystem"
"github.com/caixw/blogit/v2/internal/testdata"
"github.com/caixw/blogit/v2/internal/vars"
)
func TestVersion(t *testing.T) {
a := assert.New(t, false)
a.True(version.SemVerValid(Version(true)))
a.True(version.SemVerValid(Version(false)))
}
func TestBuild(t *testing.T) {
a := assert.New(t, false)
// Dir
destDir, err := testdata.Temp()
a.NotError(err)
dest := DirFS(destDir)
a.NotError(Build(testdata.Source, dest, nil))
a.True(filesystem.Exists(dest, "index"+vars.Ext)).
True(filesystem.Exists(dest, "tags"+vars.Ext)).
True(filesystem.Exists(dest, "tags/default"+vars.Ext)).
True(filesystem.Exists(dest, "posts/p1"+vars.Ext))
// Memory
dest = MemoryFS()
a.NotError(Build(testdata.Source, dest, nil))
a.True(filesystem.Exists(dest, "index"+vars.Ext)).
True(filesystem.Exists(dest, "tags"+vars.Ext)).
True(filesystem.Exists(dest, "tags/default"+vars.Ext)).
True(filesystem.Exists(dest, "posts/p1"+vars.Ext))
}
Go
1
https://gitee.com/caixw/blogit.git
git@gitee.com:caixw/blogit.git
caixw
blogit
blogit
master

搜索帮助