(t *testing.T)
| 199 | } |
| 200 | |
| 201 | func TestFormatFieldValue(t *testing.T) { |
| 202 | tests := []struct { |
| 203 | name string |
| 204 | value any |
| 205 | expected string |
| 206 | }{ |
| 207 | {"integer", 42, "42"}, |
| 208 | {"string", "hello", "hello"}, |
| 209 | {"empty string", "", "-"}, |
| 210 | {"float", 3.14, "3.14"}, |
| 211 | {"nil pointer", (*int)(nil), "-"}, |
| 212 | } |
| 213 | |
| 214 | for _, tt := range tests { |
| 215 | t.Run(tt.name, func(t *testing.T) { |
| 216 | val := reflect.ValueOf(tt.value) |
| 217 | result := formatFieldValue(val) |
| 218 | assert.Equal(t, tt.expected, result, "formatted field value should match expectation") |
| 219 | }) |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | func TestRenderStruct_ComplexExample(t *testing.T) { |
| 224 | // Test a more complex nested structure |
nothing calls this directly
no test coverage detected