Skip to content

Expand tests of resource resolution - #309

Merged
etr merged 6 commits into
etr:masterfrom
bcsgh:bcsgh/expand-tests-resource-resolution
Apr 10, 2023
Merged

etr merged 6 commits into
etr:masterfrom
bcsgh:bcsgh/expand-tests-resource-resolution

Conversation

@bcsgh

@bcsgh bcsgh commented Apr 6, 2023

Copy link
Copy Markdown
Contributor

Add some more test for resource resolution.

This includes

Comment thread test/integ/basic.cpp
Comment on lines +386 to +390
#ifdef CASE_INSENSITIVE
LT_CHECK_EQ(true, ws->register_resource("ok", &ok2));
#else
LT_CHECK_EQ(false, ws->register_resource("ok", &ok2));
#endif

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a bit more digging, I think these are actually backwards. And both in fact end up returning false.

tl;dr: http_endpoint::operator < is unconditionally case-insensitive:

bool http_endpoint::operator <(const http_endpoint& b) const {
COMPARATOR(url_normalized, b.url_normalized, std::toupper);
}

That's going to be a pain to fix as it's something users could be inadvertently depending on.

bcsgh added 2 commits April 5, 2023 21:58
Also add a comment that the non `-DCASE_INSENSITIVE` testcases is probably wrong.
Really this should be assigned to an issue report, not a person, because nobody has agreed to fix it yet.
@bcsgh
bcsgh marked this pull request as ready for review April 6, 2023 05:23
@etr
etr merged commit 205aea0 into etr:master Apr 10, 2023
@bcsgh
bcsgh deleted the bcsgh/expand-tests-resource-resolution branch April 11, 2023 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants