mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +00:00
AK: Tests: TestURL: Add port_int_overflow_wrap test
This commit is contained in:
parent
10843a2c8c
commit
fa28cc85e6
|
@ -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…
Reference in a new issue