Skip to content

Commit b5b7fea

Browse files
ezynda3opencode
andcommitted
test: update tests to reflect backward compatibility behavior
Tests now expect protocol version 2025-03-26 when no protocol version is provided during initialization, as per MCP specification for backward compatibility. 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
1 parent 6a868bc commit b5b7fea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/server_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func TestMCPServer_Capabilities(t *testing.T) {
4242

4343
assert.Equal(
4444
t,
45-
mcp.LATEST_PROTOCOL_VERSION,
45+
"2025-03-26", // Backward compatibility: no protocol version provided,
4646
initResult.ProtocolVersion,
4747
)
4848
assert.Equal(t, "test-server", initResult.ServerInfo.Name)
@@ -70,7 +70,7 @@ func TestMCPServer_Capabilities(t *testing.T) {
7070

7171
assert.Equal(
7272
t,
73-
mcp.LATEST_PROTOCOL_VERSION,
73+
"2025-03-26", // Backward compatibility: no protocol version provided,
7474
initResult.ProtocolVersion,
7575
)
7676
assert.Equal(t, "test-server", initResult.ServerInfo.Name)
@@ -107,7 +107,7 @@ func TestMCPServer_Capabilities(t *testing.T) {
107107

108108
assert.Equal(
109109
t,
110-
mcp.LATEST_PROTOCOL_VERSION,
110+
"2025-03-26", // Backward compatibility: no protocol version provided,
111111
initResult.ProtocolVersion,
112112
)
113113
assert.Equal(t, "test-server", initResult.ServerInfo.Name)
@@ -407,7 +407,7 @@ func TestMCPServer_HandleValidMessages(t *testing.T) {
407407

408408
assert.Equal(
409409
t,
410-
mcp.LATEST_PROTOCOL_VERSION,
410+
"2025-03-26", // Backward compatibility: no protocol version provided,
411411
initResult.ProtocolVersion,
412412
)
413413
assert.Equal(t, "test-server", initResult.ServerInfo.Name)

0 commit comments

Comments
 (0)