(ctx context.Context, t *testctx.T)
| 148 | } |
| 149 | |
| 150 | func (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 | |
| 190 | func (s *ModTreePathTestSuite) TestIsParentOf(ctx context.Context, t *testctx.T) { |
| 191 | testCases := []struct { |
nothing calls this directly
no test coverage detected