(t *testing.T)
| 458 | } |
| 459 | |
| 460 | func TestUserFunctionsMaxCodeSize(t *testing.T) { |
| 461 | var functionConfig = FunctionsConfig{ |
| 462 | MaxCodeSize: base.Ptr(20), |
| 463 | Definitions: FunctionsDefs{ |
| 464 | "square": &FunctionConfig{ |
| 465 | Type: "javascript", |
| 466 | Code: "function(context, args) {return args.numero * args.numero;}", |
| 467 | Args: []string{"numero"}, |
| 468 | Allow: &Allow{Channels: []string{"wonderland"}}, |
| 469 | }, |
| 470 | }, |
| 471 | } |
| 472 | _, err := CompileFunctions(base.TestCtx(t), functionConfig) |
| 473 | assert.ErrorContains(t, err, "function code too large (> 20 bytes)") |
| 474 | } |
| 475 | |
| 476 | // Low-level test of channel-name parameter expansion for user query/function auth |
| 477 | func TestUserFunctionAllow(t *testing.T) { |
nothing calls this directly
no test coverage detected