From f39c17354a74e69b8e35aa3a89f20323db25f216 Mon Sep 17 00:00:00 2001 From: Junshu Okamoto Date: Thu, 29 Sep 2016 21:23:18 -0700 Subject: [PATCH] test: expand test coverage for url.js 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. --- test/parallel/test-url.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/parallel/test-url.js b/test/parallel/test-url.js index 5530d285c8b94f..12c3178fb9a8e2 100644 --- a/test/parallel/test-url.js +++ b/test/parallel/test-url.js @@ -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': {