(ctx context.Context, t *testctx.T)
| 129 | } |
| 130 | |
| 131 | func (ShellSuite) TestModuleLookup(ctx context.Context, t *testctx.T) { |
| 132 | c := connect(ctx, t) |
| 133 | |
| 134 | setup := modInit(t, c, "go", `// Main module |
| 135 | // |
| 136 | // Multiline module description. |
| 137 | |
| 138 | package main |
| 139 | |
| 140 | import ( |
| 141 | "dagger/test/internal/dagger" |
| 142 | ) |
| 143 | |
| 144 | // Constructor description. |
| 145 | func New( |
| 146 | // +defaultPath=. |
| 147 | source *dagger.Directory, |
| 148 | ) *Test { |
| 149 | return &Test{Source: source} |
| 150 | } |
| 151 | |
| 152 | // Test main object |
| 153 | // |
| 154 | // Multiline object description. |
| 155 | type Test struct{ |
| 156 | Source *dagger.Directory |
| 157 | } |
| 158 | |
| 159 | // Test version |
| 160 | func (Test) Version() string { |
| 161 | return "test function" |
| 162 | } |
| 163 | |
| 164 | // Encouragement |
| 165 | func (Test) Go() string { |
| 166 | return "Let's go!" |
| 167 | } |
| 168 | `, |
| 169 | ). |
| 170 | With(withModInitAt("modules/dep", "go", `// Dependency module |
| 171 | |
| 172 | package main |
| 173 | |
| 174 | func New() *Dep { |
| 175 | return &Dep{ |
| 176 | Version: "dep function", |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | type Dep struct{ |
| 181 | // Dep version |
| 182 | Version string |
| 183 | } |
| 184 | `, |
| 185 | )). |
| 186 | With(withModInitAt("modules/git", "go", `// A git helper |
| 187 | |
| 188 | package main |
nothing calls this directly
no test coverage detected