Permalink
Browse files

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: #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 fhinkel committed Sep 30, 2016
1 parent 039f0c3 commit cad2a2f9f7da59c89112ab9e12efafeed5606ad6
Showing with 11 additions and 0 deletions.
  1. +11 −0 test/parallel/test-url.js
View
@@ -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': {

0 comments on commit cad2a2f

Please sign in to comment.