(t *testing.T)
| 41 | } |
| 42 | |
| 43 | func TestStaticExprCtxApplyOptions(t *testing.T) { |
| 44 | ctx := NewExprContext() |
| 45 | oldEvalCtx := ctx.evalCtx |
| 46 | oldColumnIDAllocator := ctx.columnIDAllocator |
| 47 | |
| 48 | // apply with options |
| 49 | opts, s := getExprCtxOptionsForTest() |
| 50 | ctx2 := ctx.Apply(opts...) |
| 51 | require.Equal(t, oldEvalCtx, ctx.evalCtx) |
| 52 | require.Same(t, oldColumnIDAllocator, ctx.columnIDAllocator) |
| 53 | checkDefaultStaticExprCtx(t, ctx) |
| 54 | checkOptionsStaticExprCtx(t, ctx2, s) |
| 55 | |
| 56 | // apply with empty options |
| 57 | ctx3 := ctx2.Apply() |
| 58 | s.skipCacheArgs = nil |
| 59 | checkOptionsStaticExprCtx(t, ctx3, s) |
| 60 | } |
| 61 | |
| 62 | func checkDefaultStaticExprCtx(t *testing.T, ctx *ExprContext) { |
| 63 | checkDefaultStaticEvalCtx(t, ctx.GetEvalCtx().(*EvalContext)) |
nothing calls this directly
no test coverage detected