MCPcopy Index your code
hub / github.com/docker/docker-agent / TestCreateWithName

Function TestCreateWithName

pkg/worktree/worktree_test.go:37–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestCreateWithName(t *testing.T) {
38 t.Parallel()
39 dir := bootstrapRepo(t)
40 root := t.TempDir()
41
42 wt, err := Create(t.Context(), dir, "my-feature", WithRoot(root))
43 require.NoError(t, err)
44
45 assert.Equal(t, "my-feature", wt.Name)
46 assert.Equal(t, "worktree-my-feature", wt.Branch)
47 assert.Equal(t, filepath.Join(root, "worktrees", "my-feature"), wt.Dir)
48 assert.FileExists(t, filepath.Join(wt.Dir, "a.txt"))
49}
50
51func TestCreateWithBaseBranchesFromRef(t *testing.T) {
52 t.Parallel()

Callers

nothing calls this directly

Calls 4

CreateFunction · 0.85
WithRootFunction · 0.85
ContextMethod · 0.80
bootstrapRepoFunction · 0.70

Tested by

no test coverage detected