mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: expand test coverage for url.js
Currently, line 156 of lib/url.js is not reachable from test-url because there is no example URL which has a white space in the front of the url. I added one example which can reach that line. PR-URL: https://github.com/nodejs/node/pull/8859 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Franziska Hinkelmann <fhinkel@vt.edu>
This commit is contained in:
1 parent
bdb6cf92c7
commit
347547a97e
1 file changed
+11
@@ -157,6 +157,17 @@ var parseTests = {
|
||||
path: '/Y'
|
||||
},
|
||||
|
||||
// whitespace in the front
|
||||
' http://www.example.com/': {
|
||||
href: 'http://www.example.com/',
|
||||
protocol: 'http:',
|
||||
slashes: true,
|
||||
host: 'www.example.com',
|
||||
hostname: 'www.example.com',
|
||||
pathname: '/',
|
||||
path: '/'
|
||||
},
|
||||
|
||||
// + not an invalid host character
|
||||
// per https://url.spec.whatwg.org/#host-parsing
|
||||
'http://x.y.com+a/b/c': {
|
||||
|
||||
Reference in new issue
Block a user