MCPcopy Index your code
hub / github.com/coder/coder / Test_DisplayTable

Function Test_DisplayTable

cli/cliui/table_test.go:64–484  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

62}
63
64func Test_DisplayTable(t *testing.T) {
65 t.Parallel()
66
67 someTime := time.Date(2022, 8, 2, 15, 49, 10, 0, time.UTC)
68 myStr := myString("my string")
69
70 // Not sorted by name or age to test sorting.
71 in := []tableTest1{
72 {
73 Name: "bar",
74 AltName: &stringWrapper{str: "bar alt"},
75 Age: 20,
76 Roles: []string{"a"},
77 Sub1: tableTest2{
78 Name: stringWrapper{str: "bar1"},
79 Age: 21,
80 },
81 Sub2: nil,
82 Sub3: tableTest3{
83 Sub: tableTest2{
84 Name: stringWrapper{str: "bar3"},
85 Age: 23,
86 },
87 },
88 Sub4: tableTest2{
89 Name: stringWrapper{str: "bar4"},
90 Age: 24,
91 },
92 Time: someTime,
93 TimePtr: nil,
94 NullTime: codersdk.NullTime{
95 NullTime: sql.NullTime{
96 Time: someTime,
97 Valid: true,
98 },
99 },
100 MyString: &myStr,
101 },
102 {
103 Name: "foo",
104 Age: 10,
105 Roles: []string{"a", "b", "c"},
106 Sub1: tableTest2{
107 Name: stringWrapper{str: "foo1"},
108 Age: 11,
109 },
110 Sub2: &tableTest2{
111 Name: stringWrapper{str: "foo2"},
112 Age: 12,
113 },
114 Sub3: tableTest3{
115 Sub: tableTest2{
116 Name: stringWrapper{str: "foo3"},
117 Age: 13,
118 },
119 },
120 Sub4: tableTest2{
121 Name: stringWrapper{str: "foo4"},

Callers

nothing calls this directly

Calls 7

DisplayTableFunction · 0.92
myStringTypeAlias · 0.85
compareTablesFunction · 0.85
LogMethod · 0.80
RunMethod · 0.65
ErrorMethod · 0.45
EmptyMethod · 0.45

Tested by

no test coverage detected