diff --git a/tests/Query.cpp b/tests/Query.cpp index 3e1957491..c7f07a34d 100644 --- a/tests/Query.cpp +++ b/tests/Query.cpp @@ -16,5 +16,27 @@ int main() { assert(uWS::getDecodedQueryValue("test2", (char *) buf.data()) == "someValue"); } + { + std::string buf = "?Kest1=&test2=someValue"; + assert(uWS::getDecodedQueryValue("test2", (char *) buf.data()) == "someValue"); + } + + { + std::string buf = "?Test1=&Kest2=some"; + assert(uWS::getDecodedQueryValue("Test1", (char *) buf.data()) == ""); + assert(uWS::getDecodedQueryValue("Kest2", (char *) buf.data()) == "some"); + } + + { + std::string buf = "?Test1=&Kest2=some"; + assert(uWS::getDecodedQueryValue("Test1", (char *) buf.data()).data() != nullptr); + assert(uWS::getDecodedQueryValue("sdfsdf", (char *) buf.data()).data() == nullptr); + } + + { + std::string buf = "?Kest1=&test2=some%20Value"; + assert(uWS::getDecodedQueryValue("test2", (char *) buf.data()) == "some Value"); + } + return 0; } \ No newline at end of file