| 647 | } |
| 648 | |
| 649 | func TestCompile_IntegerArgsFunc(t *testing.T) { |
| 650 | env := mock.Env{} |
| 651 | tests := []struct{ code string }{ |
| 652 | {"FuncInt(0)"}, |
| 653 | {"FuncInt8(0)"}, |
| 654 | {"FuncInt16(0)"}, |
| 655 | {"FuncInt32(0)"}, |
| 656 | {"FuncInt64(0)"}, |
| 657 | {"FuncUint(0)"}, |
| 658 | {"FuncUint8(0)"}, |
| 659 | {"FuncUint16(0)"}, |
| 660 | {"FuncUint32(0)"}, |
| 661 | {"FuncUint64(0)"}, |
| 662 | } |
| 663 | for _, tt := range tests { |
| 664 | t.Run(tt.code, func(t *testing.T) { |
| 665 | _, err := expr.Compile(tt.code, expr.Env(env)) |
| 666 | require.NoError(t, err) |
| 667 | }) |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | func TestCompile_call_on_nil(t *testing.T) { |
| 672 | env := map[string]any{ |