Add FileWorkspaceInfo
This commit is contained in:
18
file_test.go
18
file_test.go
@@ -3,8 +3,26 @@ package commons
|
||||
import (
|
||||
"testing"
|
||||
"slices"
|
||||
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func TestFileWorkspaceInfo(t *testing.T) {
|
||||
abs, err := filepath.Abs(".file/dir1/file1.json")
|
||||
if err != nil {
|
||||
t.Fatalf("%v", err)
|
||||
}
|
||||
|
||||
w := FileWorkspaceInfo(abs)
|
||||
if w == nil {
|
||||
t.Fatal("should have returned")
|
||||
}
|
||||
|
||||
if w.ParentDir != "dir1" {
|
||||
t.Fatalf("invalid parent dir %v", w)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFileDeepScan(t *testing.T) {
|
||||
files := make([]string, 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user