mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-16 05:26:06 +08:00
@@ -17,7 +17,6 @@
|
||||
package component
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"ragflow/internal/agent/canvas"
|
||||
@@ -31,7 +30,7 @@ func TestVariableAggregator_FirstNonEmpty(t *testing.T) {
|
||||
state.Outputs["cpn_1"] = map[string]any{"y": "second-a"}
|
||||
state.Outputs["cpn_2"] = map[string]any{"y": "second-b"}
|
||||
state.Outputs["cpn_3"] = map[string]any{"y": "second-c"}
|
||||
ctx := canvas.WithState(context.Background(), state)
|
||||
ctx := canvas.WithState(t.Context(), state)
|
||||
|
||||
groups := []map[string]any{
|
||||
{
|
||||
@@ -84,7 +83,7 @@ func TestVariableAggregator_SkipsEmptyString(t *testing.T) {
|
||||
state := canvas.NewCanvasState("run-2", "task-2")
|
||||
state.Outputs["cpn_0"] = map[string]any{"x": ""}
|
||||
state.Outputs["cpn_1"] = map[string]any{"y": "picked"}
|
||||
ctx := canvas.WithState(context.Background(), state)
|
||||
ctx := canvas.WithState(t.Context(), state)
|
||||
|
||||
groups := []map[string]any{
|
||||
{
|
||||
@@ -115,7 +114,7 @@ func TestVariableAggregator_MultipleGroups(t *testing.T) {
|
||||
state.Sys["a"] = "alpha"
|
||||
state.Sys["b"] = ""
|
||||
state.Env["c"] = "gamma"
|
||||
ctx := canvas.WithState(context.Background(), state)
|
||||
ctx := canvas.WithState(t.Context(), state)
|
||||
|
||||
groups := []map[string]any{
|
||||
{
|
||||
@@ -163,7 +162,7 @@ func TestVariableAggregator_MultipleGroups(t *testing.T) {
|
||||
func TestVariableAggregator_AllEmpty(t *testing.T) {
|
||||
state := canvas.NewCanvasState("run-4", "task-4")
|
||||
state.Outputs["cpn_0"] = map[string]any{}
|
||||
ctx := canvas.WithState(context.Background(), state)
|
||||
ctx := canvas.WithState(t.Context(), state)
|
||||
|
||||
groups := []map[string]any{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user