MCPcopy Create free account
hub / github.com/dagger/dagger / TestModuleLookup

Method TestModuleLookup

core/integration/module_shell_test.go:131–410  ·  view source on GitHub ↗
(ctx context.Context, t *testctx.T)

Source from the content-addressed store, hash-verified

129}
130
131func (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
138package main
139
140import (
141 "dagger/test/internal/dagger"
142)
143
144// Constructor description.
145func 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.
155type Test struct{
156 Source *dagger.Directory
157}
158
159// Test version
160func (Test) Version() string {
161 return "test function"
162}
163
164// Encouragement
165func (Test) Go() string {
166 return "Let's go!"
167}
168`,
169 ).
170 With(withModInitAt("modules/dep", "go", `// Dependency module
171
172package main
173
174func New() *Dep {
175 return &Dep{
176 Version: "dep function",
177 }
178}
179
180type Dep struct{
181 // Dep version
182 Version string
183}
184`,
185 )).
186 With(withModInitAt("modules/git", "go", `// A git helper
187
188package main

Callers

nothing calls this directly

Calls 13

modInitFunction · 0.85
withModInitAtFunction · 0.85
daggerExecFunction · 0.85
daggerShellFunction · 0.85
requireErrOutFunction · 0.85
connectFunction · 0.70
RunMethod · 0.65
ContainsMethod · 0.65
EqualMethod · 0.65
SyncMethod · 0.65
WithMethod · 0.45
StdoutMethod · 0.45

Tested by

no test coverage detected