MCPcopy Index your code
hub / github.com/cli/cli / Test_codespace_displayName

Function Test_codespace_displayName

pkg/cmd/codespace/common_test.go:10–139  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func Test_codespace_displayName(t *testing.T) {
11 type fields struct {
12 Codespace *api.Codespace
13 }
14 type args struct {
15 includeOwner bool
16 }
17 tests := []struct {
18 name string
19 args args
20 fields fields
21 want string
22 }{
23 {
24 name: "No included name or gitstatus",
25 args: args{},
26 fields: fields{
27 Codespace: &api.Codespace{
28 GitStatus: api.CodespaceGitStatus{
29 Ref: "trunk",
30 },
31 Repository: api.Repository{
32 FullName: "cli/cli",
33 },
34 DisplayName: "scuba steve",
35 },
36 },
37 want: "cli/cli [trunk]: scuba steve",
38 },
39 {
40 name: "No included name - included gitstatus - no unsaved changes",
41 args: args{},
42 fields: fields{
43 Codespace: &api.Codespace{
44 GitStatus: api.CodespaceGitStatus{
45 Ref: "trunk",
46 },
47 Repository: api.Repository{
48 FullName: "cli/cli",
49 },
50 DisplayName: "scuba steve",
51 },
52 },
53 want: "cli/cli [trunk]: scuba steve",
54 },
55 {
56 name: "No included name - included gitstatus - unsaved changes",
57 args: args{},
58 fields: fields{
59 Codespace: &api.Codespace{
60 GitStatus: api.CodespaceGitStatus{
61 Ref: "trunk",
62 HasUncommittedChanges: true,
63 },
64 Repository: api.Repository{
65 FullName: "cli/cli",
66 },
67 DisplayName: "scuba steve",

Callers

nothing calls this directly

Calls 3

displayNameMethod · 0.95
RunMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected