@@ -37,6 +37,14 @@ env "local" {
37
37
integer = 42
38
38
str = var.name
39
39
}
40
+
41
+ env "multi" {
42
+ url = "mysql://root:pass@localhost:3306/"
43
+ src = [
44
+ "./a.hcl",
45
+ "./b.hcl",
46
+ ]
47
+ }
40
48
`
41
49
err := os .WriteFile (filepath .Join (d , projectFileName ), []byte (h ), 0600 )
42
50
require .NoError (t , err )
@@ -52,7 +60,6 @@ env "local" {
52
60
Name : "local" ,
53
61
URL : "mysql://root:pass@localhost:3306/" ,
54
62
DevURL : "docker://mysql/8" ,
55
- Source : "./app.hcl" ,
56
63
Schemas : []string {"hello" , "world" },
57
64
MigrationDir : & MigrationDir {
58
65
URL : "file://migrations" ,
@@ -63,11 +70,22 @@ env "local" {
63
70
Attrs : []* schemahcl.Attr {
64
71
{K : "bool" , V : & schemahcl.LiteralValue {V : "true" }},
65
72
{K : "integer" , V : & schemahcl.LiteralValue {V : "42" }},
73
+ {K : "src" , V : & schemahcl.LiteralValue {V : `"./app.hcl"` }},
66
74
{K : "str" , V : & schemahcl.LiteralValue {V : `"hello"` }},
67
75
},
68
76
},
69
77
},
70
78
}, env )
79
+ sources , err := env .Sources ()
80
+ require .NoError (t , err )
81
+ require .EqualValues (t , []string {"./app.hcl" }, sources )
82
+ })
83
+ t .Run ("multi" , func (t * testing.T ) {
84
+ env , err := LoadEnv (path , "multi" )
85
+ require .NoError (t , err )
86
+ srcs , err := env .Sources ()
87
+ require .NoError (t , err )
88
+ require .EqualValues (t , []string {"./a.hcl" , "./b.hcl" }, srcs )
71
89
})
72
90
t .Run ("with input" , func (t * testing.T ) {
73
91
env , err := LoadEnv (path , "local" , WithInput (map [string ]string {
0 commit comments