TestSpec_UsageExample_ResolveThenFormat validates the documented end-to-end usage example: resolve an import input by path, then format the resolved value. Specification (Usage Examples): value, ok := importinpututil.ResolvePathValue(importInputs, "config.endpoint") formatted, ok := importinputu
(t *testing.T)
| 217 | // value, ok := importinpututil.ResolvePathValue(importInputs, "config.endpoint") |
| 218 | // formatted, ok := importinpututil.FormatResolvedValue(value) |
| 219 | func TestSpec_UsageExample_ResolveThenFormat(t *testing.T) { |
| 220 | importInputs := map[string]any{ |
| 221 | "config": map[string]any{"endpoint": "https://example.com"}, |
| 222 | } |
| 223 | |
| 224 | value, ok := importinpututil.ResolvePathValue(importInputs, "config.endpoint") |
| 225 | assert.True(t, ok, "usage example: 'config.endpoint' should resolve") |
| 226 | |
| 227 | formatted, ok := importinpututil.FormatResolvedValue(value) |
| 228 | assert.True(t, ok, "usage example: resolved value should format") |
| 229 | assert.Equal(t, "https://example.com", formatted, "usage example: scalar string formats with %v") |
| 230 | } |
nothing calls this directly
no test coverage detected