initial commit

This commit is contained in:
2025-08-05 15:53:44 +08:00
commit 09dc02ae52
553 changed files with 137665 additions and 0 deletions

23
third_party/libhv/unittest/hurl_test.cpp vendored Executable file
View File

@@ -0,0 +1,23 @@
#include <assert.h>
#include "hurl.h"
int main(int argc, char** argv) {
std::string strURL = "http://www.example.com/path?query#fragment";
HUrl url;
if (!url.parse(strURL)) {
printf("parse url %s error!\n", strURL.c_str());
return -1;
}
std::string dumpURL = url.dump();
printf("%s =>\n%s\n", strURL.c_str(), dumpURL.c_str());
assert(strURL == dumpURL);
const char* str = "中 文";
std::string escaped = HUrl::escape(str);
std::string unescaped = HUrl::unescape(escaped.c_str());
printf("%s => %s\n", str, escaped.c_str());
assert(str == unescaped);
return 0;
}