MCPcopy Create free account
hub / github.com/docker/model-test / isPathSuccessful

Method isPathSuccessful

services/test_runner.go:214–228  ·  view source on GitHub ↗

isPathSuccessful checks if actual tool calls match a specific expected path

(expected []models.ExpectedToolCall, actual []models.ActualToolCall)

Source from the content-addressed store, hash-verified

212
213// isPathSuccessful checks if actual tool calls match a specific expected path
214func (tr *TestRunner) isPathSuccessful(expected []models.ExpectedToolCall, actual []models.ActualToolCall) bool {
215 // First check: exact count match
216 if len(actual) != len(expected) {
217 return false
218 }
219
220 // Second check: all expected tools must be called correctly in order
221 for i, expectedTool := range expected {
222 if i >= len(actual) || !tr.isToolCallCorrect(expectedTool, actual[i]) {
223 return false
224 }
225 }
226
227 return true
228}
229
230// isToolCallCorrect checks if an actual tool call matches an expected one
231func (tr *TestRunner) isToolCallCorrect(expected models.ExpectedToolCall, actual models.ActualToolCall) bool {

Callers 1

evaluateAgentResponseMethod · 0.95

Calls 1

isToolCallCorrectMethod · 0.95

Tested by

no test coverage detected