MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / passthroughFn

Function passthroughFn

go/engine/node/functioncall_test.go:25–47  ·  view source on GitHub ↗

passthroughFn returns a Function with one Int arg "a" and one Int return "ret" where ret = a (passthrough). InitialState is idle so Function.Call evaluates only the OutputAssignments — no actions required.

()

Source from the content-addressed store, hash-verified

23// where ret = a (passthrough). The entry transition targets StateIdle so
24// Function.Call evaluates only the OutputAssignments — no executable nodes required.
25func passthroughFn() *engine.Function {
26 return &engine.Function{
27 Info: workflowapi.FunctionInfo{
28 Id: "fn1",
29 Name: "passthrough",
30 Arguments: []workflowapi.Variable{
31 {Uid: "a", Name: "a", DataType: workflowapi.Int},
32 },
33 Returns: []workflowapi.Variable{
34 {Uid: "ret", Name: "value", DataType: workflowapi.Int},
35 },
36 },
37 EntryTransition: engine.Transition{TargetID: engine.StateIdle},
38 Executables: map[string]engine.Executable{},
39 OutputAssignments: map[string]workflowapi.Expression{
40 "ret": {
41 Expression: "${}",
42 DataType: workflowapi.Int,
43 References: []workflowapi.Reference{{SrcId: engine.SrcFnArg, VarId: "a"}},
44 },
45 },
46 }
47}
48
49func TestNewFunctionCall(t *testing.T) {
50 t.Run("missing input binding errors", func(t *testing.T) {

Callers 2

TestNewFunctionCallFunction · 0.85
TestFunctionCall_ExecuteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected