1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 22:45:07 +00:00
serenity/Tests/LibWeb/Text/expected/URL/url.txt
Shannon Booth 453dd0cf44 AK: Properly implement steps for shortening a URLs path
Instead of implementing this inline, put it into a function. Use this
new function to correctly implement shortening paths for some places
where this logic was previously missing.

Before these changes, the pathname for the included test was incorrectly
being set to '/' as we were not considering the windows drive letter.
2023-10-26 11:11:41 +02:00

80 lines
1.6 KiB
Text

new URL('ftp://serenityos.org:21', undefined)
protocol => 'ftp:'
username => ''
password => ''
host => 'serenityos.org'
hostname => 'serenityos.org'
port => ''
pathname => '/'
search => ''
hash => ''
new URL('http://[0:1:0:1:0:1:0:1]', undefined)
protocol => 'http:'
username => ''
password => ''
host => '[0:1:0:1:0:1:0:1]'
hostname => '[0:1:0:1:0:1:0:1]'
port => ''
pathname => '/'
search => ''
hash => ''
new URL('http://[1:0:1:0:1:0:1:0]', undefined)
protocol => 'http:'
username => ''
password => ''
host => '[1:0:1:0:1:0:1:0]'
hostname => '[1:0:1:0:1:0:1:0]'
port => ''
pathname => '/'
search => ''
hash => ''
new URL('http://[1:1:0:0:1:0:0:0]/', undefined)
protocol => 'http:'
username => ''
password => ''
host => '[1:1:0:0:1::]'
hostname => '[1:1:0:0:1::]'
port => ''
pathname => '/'
search => ''
hash => ''
new URL('unknown://serenityos.org:0', undefined)
protocol => 'unknown:'
username => ''
password => ''
host => 'serenityos.org:0'
hostname => 'serenityos.org'
port => '0'
pathname => ''
search => ''
hash => ''
new URL('http://serenityos.org/cat?dog#meow"woof', undefined)
protocol => 'http:'
username => ''
password => ''
host => 'serenityos.org'
hostname => 'serenityos.org'
port => ''
pathname => '/cat'
search => '?dog'
hash => '#meow%22woof'
new URL('/hello', 'file://friends/')
protocol => 'file:'
username => ''
password => ''
host => 'friends'
hostname => 'friends'
port => ''
pathname => '/hello'
search => ''
hash => ''
new URL('//d:/..', 'file:///C:/a/b')
protocol => 'file:'
username => ''
password => ''
host => ''
hostname => ''
port => ''
pathname => '/d:/'
search => ''
hash => ''