(t *testing.T)
| 106 | } |
| 107 | |
| 108 | func 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 | |
| 128 | func TestValFromJqPath(t *testing.T) { |
| 129 | tests := []struct { |
nothing calls this directly
no test coverage detected