MCPcopy Index your code
hub / github.com/dagger/dagger / TestModuleLocalPathString

Method TestModuleLocalPathString

core/modtree_test.go:150–188  ·  view source on GitHub ↗
(ctx context.Context, t *testctx.T)

Source from the content-addressed store, hash-verified

148}
149
150func (s *ModTreeNodeTestSuite) TestModuleLocalPathString(ctx context.Context, t *testctx.T) {
151 cache, err := dagql.NewCache(ctx, "", nil, nil)
152 require.NoError(t, err)
153 ctx = dagql.ContextWithCache(ctx, cache)
154
155 dag := newCoreDagqlServerForTest(t, &Query{})
156 dag.InstallObject(dagql.NewClass(dag, dagql.ClassOpts[*Module]{Typed: &Module{}}))
157
158 mod := newTypeDefAttachedResult(t, ctx, cache, dag, "module", &Module{})
159
160 moduleRoot := &ModTreeNode{Module: mod}
161 require.Equal(t, "generate-dagger-runtimes", (&ModTreeNode{
162 Parent: moduleRoot,
163 Name: "GenerateDaggerRuntimes",
164 Module: mod,
165 }).moduleLocalPathString())
166
167 workspaceRoot := &ModTreeNode{
168 Parent: &ModTreeNode{},
169 Name: "Go",
170 Module: mod,
171 }
172 require.Equal(t, "generate-dagger-runtimes", (&ModTreeNode{
173 Parent: workspaceRoot,
174 Name: "GenerateDaggerRuntimes",
175 Module: mod,
176 }).moduleLocalPathString())
177
178 workspaceNested := &ModTreeNode{
179 Parent: workspaceRoot,
180 Name: "TestSplit",
181 Module: mod,
182 }
183 require.Equal(t, "test-split:test-cli-engine", (&ModTreeNode{
184 Parent: workspaceNested,
185 Name: "TestCliEngine",
186 Module: mod,
187 }).moduleLocalPathString())
188}
189
190func (s *ModTreePathTestSuite) TestIsParentOf(ctx context.Context, t *testctx.T) {
191 testCases := []struct {

Callers

nothing calls this directly

Calls 8

NewCacheFunction · 0.92
ContextWithCacheFunction · 0.92
NewClassFunction · 0.92
newTypeDefAttachedResultFunction · 0.85
moduleLocalPathStringMethod · 0.80
InstallObjectMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected