MCPcopy
hub / github.com/vxcontrol/pentagi / TestIsBarrierFunction

Function TestIsBarrierFunction

backend/pkg/tools/executor_test.go:139–169  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

137}
138
139func TestIsBarrierFunction(t *testing.T) {
140 t.Parallel()
141
142 ce := &customExecutor{
143 barriers: map[string]struct{}{
144 FinalyToolName: {},
145 AskUserToolName: {},
146 },
147 }
148
149 tests := []struct {
150 name string
151 toolName string
152 want bool
153 }{
154 {name: "done is barrier", toolName: FinalyToolName, want: true},
155 {name: "ask is barrier", toolName: AskUserToolName, want: true},
156 {name: "terminal is not barrier", toolName: TerminalToolName, want: false},
157 {name: "empty string is not barrier", toolName: "", want: false},
158 }
159
160 for _, tt := range tests {
161 t.Run(tt.name, func(t *testing.T) {
162 t.Parallel()
163
164 if got := ce.IsBarrierFunction(tt.toolName); got != tt.want {
165 t.Errorf("IsBarrierFunction(%q) = %v, want %v", tt.toolName, got, tt.want)
166 }
167 })
168 }
169}
170
171func TestGetBarrierToolNames(t *testing.T) {
172 t.Parallel()

Callers

nothing calls this directly

Calls 2

IsBarrierFunctionMethod · 0.95
RunMethod · 0.65

Tested by

no test coverage detected