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

Function TestSpec_UsageExample_ResolveThenFormat

pkg/importinpututil/spec_test.go:219–230  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

217// value, ok := importinpututil.ResolvePathValue(importInputs, "config.endpoint")
218// formatted, ok := importinpututil.FormatResolvedValue(value)
219func 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}

Callers

nothing calls this directly

Calls 2

ResolvePathValueFunction · 0.92
FormatResolvedValueFunction · 0.92

Tested by

no test coverage detected