Move Generation Destinations
This commit is contained in:
@@ -82,6 +82,29 @@ func TestTopDataAssetsDirReturnsEmptyForNoConfig(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateLayoutCreatesMissingCacheAssetsDir(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
mkdirAll(t, filepath.Join(root, "src"))
|
||||
mkdirAll(t, filepath.Join(root, "build"))
|
||||
|
||||
proj := &Project{
|
||||
Root: root,
|
||||
Config: Config{
|
||||
Module: ModuleConfig{Name: "Test", ResRef: "test"},
|
||||
Paths: PathConfig{Source: "src", Assets: ".cache/module-assets", Build: "build"},
|
||||
},
|
||||
}
|
||||
|
||||
if err := proj.ValidateLayout(); err != nil {
|
||||
t.Fatalf("ValidateLayout returned error: %v", err)
|
||||
}
|
||||
if info, err := os.Stat(filepath.Join(root, ".cache", "module-assets")); err != nil {
|
||||
t.Fatalf("expected cache assets dir to be created: %v", err)
|
||||
} else if !info.IsDir() {
|
||||
t.Fatalf("expected cache assets path to be a directory")
|
||||
}
|
||||
}
|
||||
|
||||
func mkdirAll(t *testing.T, path string) {
|
||||
t.Helper()
|
||||
if err := os.MkdirAll(path, 0o755); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user