3 Star 0 Fork 1

Gitee 极速下载 / tealeg-xlsx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/tealeg/xlsx
克隆/下载
testutil.go 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
Olivier Mengué 提交于 2023-06-07 18:27 . Enable parallel testing
package xlsx
import (
"os"
"path/filepath"
qt "github.com/frankban/quicktest"
)
// cleanTempDir removes all the temporary files from NewDiskVCellStore
func cleanTempDir(c *qt.C) {
tempDirBase := os.TempDir()
globPattern := tempDirBase + "/" + cellStorePrefix + "*"
dirs, err := filepath.Glob(globPattern)
if err != nil {
c.Logf("Cannot glob files of %s", globPattern)
c.FailNow()
}
for _, directory := range dirs {
if err = os.RemoveAll(directory); err != nil {
c.Logf("Cannot remove files of %s", directory)
c.FailNow()
}
}
}
// csRunC will run the given test function with all available
// CellStoreConstructors. You must take care of setting the
// CellStoreConstructors on the File struct or whereever else it is needed.
func csRunC(c *qt.C, description string, test func(c *qt.C, constructor CellStoreConstructor)) {
c.Run(description, func(c *qt.C) {
c.Run("MemoryCellStore", func(c *qt.C) {
c.Parallel()
test(c, NewMemoryCellStore)
})
c.Run("DiskVCellStore", func(c *qt.C) {
c.Parallel()
test(c, NewDiskVCellStore)
})
})
c.TB.Cleanup(func() {
if !c.Failed() {
cleanTempDir(c)
}
})
}
// csRunO will run the given test function with all available CellStore FileOptions, you must takes care of passing the FileOption to the appropriate method.
func csRunO(c *qt.C, description string, test func(c *qt.C, option FileOption)) {
c.Run(description, func(c *qt.C) {
c.Run("MemoryCellStore", func(c *qt.C) {
c.Parallel()
test(c, UseMemoryCellStore)
})
c.Run("DiskVCellStore", func(c *qt.C) {
c.Parallel()
test(c, UseDiskVCellStore)
})
})
c.TB.Cleanup(func() {
if !c.Failed() {
cleanTempDir(c)
}
})
}
1
https://gitee.com/mirrors/tealeg-xlsx.git
git@gitee.com:mirrors/tealeg-xlsx.git
mirrors
tealeg-xlsx
tealeg-xlsx
master

搜索帮助