Go: add context, part5 (#17392)

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-07-27 10:20:16 +08:00
committed by GitHub
parent 4b39106cd4
commit f53518c110
182 changed files with 1249 additions and 1066 deletions

View File

@@ -36,7 +36,7 @@ func TestStringTransform_SplitBasic(t *testing.T) {
state := canvas.NewCanvasState("run-1", "task-1")
ctx := canvas.WithState(context.Background(), state)
out, err := c.Invoke(ctx, map[string]any{"line": "a,b;c"})
out, err := c.Invoke(ctx, nil, map[string]any{"line": "a,b;c"})
if err != nil {
t.Fatalf("Invoke: %v", err)
}
@@ -56,7 +56,7 @@ func TestStringTransform_SplitNoDelim(t *testing.T) {
state := canvas.NewCanvasState("run-2", "task-2")
ctx := canvas.WithState(context.Background(), state)
out, err := c.Invoke(ctx, map[string]any{"line": "abc"})
out, err := c.Invoke(ctx, nil, map[string]any{"line": "abc"})
if err != nil {
t.Fatalf("Invoke: %v", err)
}
@@ -77,7 +77,7 @@ func TestStringTransform_Merge(t *testing.T) {
state := canvas.NewCanvasState("run-3", "task-3")
ctx := canvas.WithState(context.Background(), state)
out, err := c.Invoke(ctx, map[string]any{"x": "foo", "y": "bar"})
out, err := c.Invoke(ctx, nil, map[string]any{"x": "foo", "y": "bar"})
if err != nil {
t.Fatalf("Invoke: %v", err)
}
@@ -97,7 +97,7 @@ func TestStringTransform_MergeIterationAliases(t *testing.T) {
state.Globals["__index__"] = 1
ctx := canvas.WithState(context.Background(), state)
out, err := c.Invoke(ctx, map[string]any{})
out, err := c.Invoke(ctx, nil, map[string]any{})
if err != nil {
t.Fatalf("Invoke: %v", err)
}
@@ -118,7 +118,7 @@ func TestStringTransform_SplitFromStateRef(t *testing.T) {
state.Outputs["cpn_0"] = map[string]any{"x": "alpha,beta,gamma"}
ctx := canvas.WithState(context.Background(), state)
out, err := c.Invoke(ctx, nil)
out, err := c.Invoke(ctx, nil, nil)
if err != nil {
t.Fatalf("Invoke: %v", err)
}
@@ -140,7 +140,7 @@ func TestStringTransform_MergeMissingPlaceholder(t *testing.T) {
state := canvas.NewCanvasState("run-5", "task-5")
ctx := canvas.WithState(context.Background(), state)
out, err := c.Invoke(ctx, map[string]any{})
out, err := c.Invoke(ctx, nil, map[string]any{})
if err != nil {
t.Fatalf("Invoke: %v", err)
}