Skip to content

Commit 2f0e9a6

Browse files
committed
changes after code review #449 (comment)
1 parent 8e85125 commit 2f0e9a6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

mcptest/mcptest_test.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,21 @@ func TestServerWithResourceTemplate(t *testing.T) {
210210
if !ok {
211211
return nil, fmt.Errorf("expected userId argument to be populated from URI template")
212212
}
213-
if len(userIds) != 1 && userIds[0] != "john" {
214-
return nil, fmt.Errorf("expected userId argument to be 'john', got %v", userIds)
213+
if len(userIds) != 1 {
214+
return nil, fmt.Errorf("expected userId to have one value, but got %d", len(userIds))
215+
}
216+
if userIds[0] != "john" {
217+
return nil, fmt.Errorf("expected userId argument to be 'john', got %s", userIds[0])
215218
}
216219

217220
docIds, ok := request.Params.Arguments["docId"].([]string)
218221
if !ok {
219222
return nil, fmt.Errorf("expected docId argument to be populated from URI template")
220223
}
221-
if len(docIds) != 1 && docIds[0] != "readme.txt" {
224+
if len(docIds) != 1 {
225+
return nil, fmt.Errorf("expected docId to have one value, but got %d", len(docIds))
226+
}
227+
if docIds[0] != "readme.txt" {
222228
return nil, fmt.Errorf("expected docId argument to be 'readme.txt', got %v", docIds)
223229
}
224230

0 commit comments

Comments
 (0)