Skip to content

Commit

Permalink
test: expand test coverage for url.js
Browse files Browse the repository at this point in the history
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: #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>
  • Loading branch information
jun-oka authored and Myles Borins committed Nov 18, 2016
1 parent bdb6cf9 commit 347547a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/parallel/test-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down

0 comments on commit 347547a

Please sign in to comment.