MCPcopy Create free account
hub / github.com/github/gh-aw / TestFormatFieldValue_UnexportedFields

Function TestFormatFieldValue_UnexportedFields

pkg/console/render_formatting_test.go:132–148  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

130}
131
132func TestFormatFieldValue_UnexportedFields(t *testing.T) {
133 // Test handling of unexported fields (can't use Interface())
134 type testStruct struct {
135 exported int
136 unexported int
137 }
138
139 s := testStruct{exported: 42, unexported: 99}
140 val := reflect.ValueOf(s)
141
142 // Test unexported field formatting
143 unexportedField := val.FieldByName("unexported")
144 result := formatFieldValue(unexportedField)
145 if result != "99" {
146 t.Errorf("unexported int field: got %q, want %q", result, "99")
147 }
148}
149
150func TestFormatFieldValue_BoolType(t *testing.T) {
151 tests := []struct {

Callers

nothing calls this directly

Calls 2

formatFieldValueFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected