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 are no example URL which has white space in the front of url.
I added one example which can reach that line.
  • Loading branch information
jun-oka committed Sep 30, 2016
1 parent 7bc6aea commit f39c173
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 @@ -158,6 +158,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 f39c173

Please sign in to comment.