Created
December 6, 2019 00:06
-
-
Save vinniefalco/f83c1290aeb5d8b9e438cd022d40a46b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void | |
testAuthority() | |
{ | |
value u; | |
BEAST_EXPECT(u.encoded_authority() == ""); | |
u.set_username("joe"); | |
BEAST_EXPECT(u.encoded_authority() == "joe@"); | |
u.set_password("password"); | |
BEAST_EXPECT(u.encoded_authority() == "joe:password@"); | |
u.set_hostname("example.com"); | |
BEAST_EXPECT(u.encoded_authority() == "joe:password@example.com"); | |
u.set_port(443); | |
BEAST_EXPECT(u.encoded_authority() == "joe:password@example.com:443"); | |
u.set_password(""); | |
BEAST_EXPECT(u.encoded_authority() == "joe@example.com:443"); | |
u.set_username(""); | |
BEAST_EXPECT(u.encoded_authority() == "example.com:443"); | |
BEAST_EXPECT(u.encoded_authority() == u.encoded_host()); | |
u.set_port({}); | |
BEAST_EXPECT(u.encoded_authority() == "example.com"); | |
BEAST_EXPECT(u.encoded_authority() == u.encoded_host()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment