Add FileWorkspaceInfo

This commit is contained in:
George Suntres
2026-04-01 20:40:25 -04:00
parent 21fb60b7a9
commit e732870865
5 changed files with 77 additions and 5 deletions

View File

@@ -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)