mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-29 12:09:31 +08:00
Go: add context, part5 (#17392)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user