diff --git a/tests/net/webrequest.cpp b/tests/net/webrequest.cpp index dfb0465183..b8c8de79a9 100644 --- a/tests/net/webrequest.cpp +++ b/tests/net/webrequest.cpp @@ -223,8 +223,21 @@ TEST_CASE_METHOD(RequestFixture, // We ought to really parse the returned JSON object, but to keep things as // simple as possible for now we just treat it as a string. - CHECK_THAT( request.GetResponse().AsString().ToStdString(), - Catch::Contains("\"pi\": \"3.14159265358979323\"") ); + const wxString& response = request.GetResponse().AsString(); + INFO("Response: " << response); + + const char* expectedKey = "\"pi\":"; + size_t pos = response.find(expectedKey); + REQUIRE( pos != wxString::npos ); + + pos += strlen(expectedKey); + + // There may, or not, be a space after it. + while ( wxIsspace(response[pos]) ) + pos++; + + const char* expectedValue = "\"3.14159265358979323\""; + REQUIRE( response.compare(pos, strlen(expectedValue), expectedValue) == 0 ); } TEST_CASE_METHOD(RequestFixture,