feat(Go-Tool):添加FileUtil.go、FileReadTool.go单测类代码,修改相应bug-----IniTool.go依赖获取不到,注释掉代码、创建ArrayUtil.go,添加数组对应方法
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* @Author : huangzj
|
||||
* @Time : 2020/4/30 14:55
|
||||
* @Description: 文件读取工具测试
|
||||
*/
|
||||
|
||||
package file
|
||||
|
||||
import (
|
||||
"Go-Tool/util/file"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestReadFileLineNum(t *testing.T) {
|
||||
fmt.Print(file.ReadFileLineNum("F:\\Go个人代码\\src\\Go-Tool\\test\\emptyDirTest\\1\\11.txt"))
|
||||
}
|
||||
|
||||
func TestReadFileLineNumExceptEmptyLine(t *testing.T) {
|
||||
fmt.Println(file.ReadFileLineNumExceptEmptyLine("F:\\Go个人代码\\src\\Go-Tool\\test\\emptyDirTest\\1\\11.txt"))
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* @Author : huangzj
|
||||
* @Time : 2020/4/30 14:56
|
||||
* @Description: 文件工具测试
|
||||
*/
|
||||
|
||||
package file
|
||||
|
||||
import (
|
||||
"Go-Tool/util/file"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var (
|
||||
filePaths = [5]string{"F:\\Go个人代码\\src\\Go-Tool\\test\\emptyDirTest\\1\\11.txt",
|
||||
"F:\\Go个人代码\\src\\Go-Tool\\test\\emptyDirTest\\2\\1\\11.txt",
|
||||
"F:\\Go个人代码\\src\\Go-Tool\\test\\emptyDirTest\\2\\2222\\4\\4\\111.txt",
|
||||
"F:\\Go个人代码\\src\\Go-Tool\\test\\emptyDirTest\\2\\2222\\4\\4\\4\\4\\1211.txt",
|
||||
"F:\\Go个人代码\\src\\Go-Tool\\test\\emptyDirTest\\3\\11.txt"}
|
||||
)
|
||||
|
||||
func TestGetAllFileNameFromDir(t *testing.T) {
|
||||
s := file.GetAllFileNameFromDir("F:\\Go个人代码\\src\\Go-Tool\\test\\emptyDirTest")
|
||||
|
||||
for _, row := range s {
|
||||
fmt.Print(row)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetAllEmptyDir(t *testing.T) {
|
||||
_, s := file.GetAllEmptyDir("F:\\Go个人代码\\src\\Go-Tool\\test\\emptyDirTest")
|
||||
|
||||
for _, row := range s {
|
||||
fmt.Print(fmt.Sprint(row, "\n\n"))
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetAllDir(t *testing.T) {
|
||||
_, s := file.GetAllDir("F:\\Go个人代码\\src\\Go-Tool\\test\\emptyDirTest")
|
||||
|
||||
for _, row := range s {
|
||||
fmt.Print(row)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetAllNotEmptyDir(t *testing.T) {
|
||||
_, s := file.GetAllNotEmptyDir("F:\\Go个人代码\\src\\Go-Tool\\test\\emptyDirTest")
|
||||
|
||||
for _, row := range s {
|
||||
fmt.Print(row)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* @Author : huangzj
|
||||
* @Time : 2020/4/30 14:56
|
||||
* @Description: 文件写入工具测试
|
||||
*/
|
||||
|
||||
package file
|
||||
Reference in New Issue
Block a user