(t *testing.T)
| 164 | } |
| 165 | |
| 166 | func 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 | |
| 189 | func TestFunctionHashFiles(t *testing.T) { |
| 190 | table := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…