Skip to content

Commit 347547a

Browse files
jun-okaMyles Borins
authored and
Myles Borins
committedNov 18, 2016
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 <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
1 parent bdb6cf9 commit 347547a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎test/parallel/test-url.js

+11
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,17 @@ var parseTests = {
157157
path: '/Y'
158158
},
159159

160+
// whitespace in the front
161+
' http://www.example.com/': {
162+
href: 'http://www.example.com/',
163+
protocol: 'http:',
164+
slashes: true,
165+
host: 'www.example.com',
166+
hostname: 'www.example.com',
167+
pathname: '/',
168+
path: '/'
169+
},
170+
160171
// + not an invalid host character
161172
// per https://url.spec.whatwg.org/#host-parsing
162173
'http://x.y.com+a/b/c': {

0 commit comments

Comments
 (0)
Please sign in to comment.