(t *testing.T)
| 213 | } |
| 214 | |
| 215 | func TestRun_FastMethods(t *testing.T) { |
| 216 | input := `hello() + world()` |
| 217 | |
| 218 | tree, err := parser.Parse(input) |
| 219 | require.NoError(t, err) |
| 220 | |
| 221 | env := map[string]any{ |
| 222 | "hello": func(...any) any { return "hello " }, |
| 223 | "world": func(...any) any { return "world" }, |
| 224 | } |
| 225 | funcConf := conf.New(env) |
| 226 | _, err = checker.Check(tree, funcConf) |
| 227 | require.NoError(t, err) |
| 228 | |
| 229 | program, err := compiler.Compile(tree, funcConf) |
| 230 | require.NoError(t, err) |
| 231 | |
| 232 | out, err := vm.Run(program, env) |
| 233 | require.NoError(t, err) |
| 234 | |
| 235 | require.Equal(t, "hello world", out) |
| 236 | } |
| 237 | |
| 238 | func TestRun_InnerMethodWithError(t *testing.T) { |
| 239 | input := `InnerEnv.WillError("yes")` |
nothing calls this directly
no test coverage detected
searching dependent graphs…