@@ -4154,8 +4154,8 @@ void test_server_protocol_version()
41544154 client::Client c (std::make_unique<client::LoopbackTransport>(srv));
41554155
41564156 auto info = c.initialize ();
4157- assert (info.contains ( " protocolVersion" ));
4158- assert (info[ " protocolVersion" ] == " 2024-11-05" );
4157+ assert (! info.protocolVersion . empty ( ));
4158+ assert (info. protocolVersion == " 2024-11-05" );
41594159
41604160 std::cout << " [PASS] protocol version returned\n " ;
41614161}
@@ -4168,9 +4168,9 @@ void test_server_info()
41684168 client::Client c (std::make_unique<client::LoopbackTransport>(srv));
41694169
41704170 auto info = c.initialize ();
4171- assert (info.contains ( " serverInfo" ));
4172- assert (info[ " serverInfo" ][ " name" ] == " test_server" );
4173- assert (info[ " serverInfo" ][ " version" ] == " 1.0.0" );
4171+ assert (! info.serverInfo . name . empty ( ));
4172+ assert (info. serverInfo . name == " test_server" );
4173+ assert (info. serverInfo . version == " 1.0.0" );
41744174
41754175 std::cout << " [PASS] server info returned\n " ;
41764176}
@@ -4183,10 +4183,9 @@ void test_server_capabilities()
41834183 client::Client c (std::make_unique<client::LoopbackTransport>(srv));
41844184
41854185 auto info = c.initialize ();
4186- assert (info.contains (" capabilities" ));
4187- assert (info[" capabilities" ].contains (" tools" ));
4188- assert (info[" capabilities" ].contains (" resources" ));
4189- assert (info[" capabilities" ][" tools" ][" listChanged" ] == true );
4186+ assert (info.capabilities .tools .has_value ());
4187+ assert (info.capabilities .resources .has_value ());
4188+ assert ((*info.capabilities .tools )[" listChanged" ] == true );
41904189
41914190 std::cout << " [PASS] capabilities returned\n " ;
41924191}
@@ -4199,8 +4198,8 @@ void test_server_instructions()
41994198 client::Client c (std::make_unique<client::LoopbackTransport>(srv));
42004199
42014200 auto info = c.initialize ();
4202- assert (info.contains ( " instructions" ));
4203- assert (info[ " instructions" ] == " Server with full capabilities" );
4201+ assert (info.instructions . has_value ( ));
4202+ assert (* info. instructions == " Server with full capabilities" );
42044203
42054204 std::cout << " [PASS] instructions returned\n " ;
42064205}
0 commit comments