MCPcopy Index your code
hub / github.com/bootdotdev/bootdev / TestFormatJqExpectedValueInterpolatesOnlyStrings

Function TestFormatJqExpectedValueInterpolatesOnlyStrings

checks/jq_test.go:108–126  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

106}
107
108func TestFormatJqExpectedValueInterpolatesOnlyStrings(t *testing.T) {
109 variables := map[string]string{"name": "Theo"}
110
111 gotString := formatJqExpectedValue(api.JqExpectedResult{
112 Type: api.JqTypeString,
113 Value: "hello ${name}",
114 }, variables)
115 if gotString != `"hello Theo"` {
116 t.Fatalf("expected interpolated string value, got %q", gotString)
117 }
118
119 gotInt := formatJqExpectedValue(api.JqExpectedResult{
120 Type: api.JqTypeInt,
121 Value: "${name}",
122 }, variables)
123 if gotInt != `"${name}"` {
124 t.Fatalf("expected non-string jq type to avoid interpolation, got %q", gotInt)
125 }
126}
127
128func TestValFromJqPath(t *testing.T) {
129 tests := []struct {

Callers

nothing calls this directly

Calls 1

formatJqExpectedValueFunction · 0.85

Tested by

no test coverage detected