mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix curl compatibility issues with colorize_url (#14615)
Also move the escape code safety check to guiOpenURL.
This commit is contained in:
parent
780543f0a2
commit
59bf1d8cd9
4 changed files with 36 additions and 20 deletions
|
@ -728,16 +728,18 @@ void TestUtilities::testIsBlockInSight()
|
|||
|
||||
void TestUtilities::testColorizeURL()
|
||||
{
|
||||
#if USE_CURL
|
||||
#ifdef HAVE_COLORIZE_URL
|
||||
#define RED COLOR_CODE("#faa")
|
||||
#define GREY COLOR_CODE("#aaa")
|
||||
#define WHITE COLOR_CODE("#fff")
|
||||
|
||||
std::string result = colorize_url("http://example.com/");
|
||||
UASSERT(result == (GREY "http://" WHITE "example.com" GREY "/"));
|
||||
UASSERTEQ(auto, result, (GREY "http://" WHITE "example.com" GREY "/"));
|
||||
|
||||
result = colorize_url(u8"https://u:p@wikipedi\u0430.org:1234/heIIoll?a=b#c");
|
||||
UASSERT(result ==
|
||||
UASSERTEQ(auto, result,
|
||||
(GREY "https://u:p@" WHITE "wikipedi" RED "%d0%b0" WHITE ".org" GREY ":1234/heIIoll?a=b#c"));
|
||||
#else
|
||||
warningstream << "Test skipped." << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue