MCPcopy
hub / github.com/nektos/act / TestFunctionFromJSON

Function TestFunctionFromJSON

pkg/exprparser/functions_test.go:166–187  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

164}
165
166func TestFunctionFromJSON(t *testing.T) {
167 table := []struct {
168 input string
169 expected interface{}
170 name string
171 }{
172 {"fromJSON('{\"foo\":\"bar\"}') }}", map[string]interface{}{
173 "foo": "bar",
174 }, "fromJSON"},
175 }
176
177 env := &EvaluationEnvironment{}
178
179 for _, tt := range table {
180 t.Run(tt.name, func(t *testing.T) {
181 output, err := NewInterpeter(env, Config{}).Evaluate(tt.input, DefaultStatusCheckNone)
182 assert.Nil(t, err)
183
184 assert.Equal(t, tt.expected, output)
185 })
186 }
187}
188
189func TestFunctionHashFiles(t *testing.T) {
190 table := []struct {

Callers

nothing calls this directly

Calls 2

NewInterpeterFunction · 0.85
EvaluateMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…