mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 03:29:49 +00:00
AK: Tests: TestURL: Add port_int_overflow_wrap test
This commit is contained in:
parent
10843a2c8c
commit
fa28cc85e6
Notes:
sideshowbarker
2024-07-18 21:16:46 +09:00
Author: https://github.com/bcoles
Commit: fa28cc85e6
Pull-request: https://github.com/SerenityOS/serenity/pull/5841
1 changed files with 8 additions and 0 deletions
|
@ -213,4 +213,12 @@ TEST_CASE(trailing_port)
|
||||||
EXPECT_EQ(url.port(), 8086);
|
EXPECT_EQ(url.port(), 8086);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE(port_int_overflow_wrap)
|
||||||
|
{
|
||||||
|
auto expected_port = 80;
|
||||||
|
URL url(String::formatted("http://example.com:{}/", (u32)((65536 * 1000) + expected_port)));
|
||||||
|
EXPECT_EQ(url.port(), expected_port);
|
||||||
|
EXPECT_EQ(url.is_valid(), true);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_MAIN(URL)
|
TEST_MAIN(URL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue