Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: expand test coverage for url.js #8976

Closed
wants to merge 3 commits into from

Conversation

jun-oka
Copy link
Contributor

@jun-oka jun-oka commented Oct 7, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test url

Description of change

Currently line 309 of lib/url.js is not reachable from test-url because there are no examples which have more than 255 characters in the hostname of the url.
I added one example which can reach that line.

Currently Line 309 of lib/url.js is not reachable from test-url because there are no examples which has more than 255 characters in the hostname of the url.
I added one example which can reach that line.
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Oct 7, 2016
@mscdex mscdex added the url Issues and PRs related to the legacy built-in url module. label Oct 7, 2016
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if CI is good.

@@ -1200,6 +1204,17 @@ var formatTests = {
pathname: '/'
},

// more than 255 characters in hostname which excesses the limit
[excessHostnameUrl]: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Maybe get rid of excessHostnameUrl const altogether and change this line to:

[`http://${'a'.repeat(255)}.com/node`]: {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK!

@@ -1200,6 +1204,17 @@ var formatTests = {
pathname: '/'
},

// more than 255 characters in hostname which excesses the limit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: excesses -> exceeds

@Trott
Copy link
Member

Trott commented Oct 7, 2016

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits addressed and green CI

Copy link
Member

@imyller imyller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with good CI and nits addressed

delete excessHostnameUrl and add exceeded hostname url directly.
@jun-oka
Copy link
Contributor Author

jun-oka commented Oct 7, 2016

Thank you for the nits. I have updated.

@@ -999,6 +999,7 @@ for (const u in parseTestsWithQueryString) {

// some extra formatting tests, just to verify
// that it'll format slightly wonky content to a valid url.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: please remove this empty line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry. I forgot to delete.

Copy link
Member

@imyller imyller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@lpinca lpinca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasnell
Copy link
Member

jasnell commented Oct 8, 2016

only flaky failures in CI. Will land this.

@jasnell jasnell self-assigned this Oct 8, 2016
@jasnell
Copy link
Member

jasnell commented Oct 8, 2016

Landed in 5050fb4. Thank you!

@jasnell jasnell closed this Oct 8, 2016
jasnell pushed a commit that referenced this pull request Oct 8, 2016
Add url example with more than 255 characters in the hostname
of the url.

PR-URL: #8976
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member

jasnell commented Oct 8, 2016

Scratch that, botched the commit log message... landed correctly in 7084b9c

jasnell pushed a commit that referenced this pull request Oct 10, 2016
Add url example with more than 255 characters in the hostname
of the url.

PR-URL: #8976
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Fishrock123 pushed a commit that referenced this pull request Oct 11, 2016
Add url example with more than 255 characters in the hostname
of the url.

PR-URL: #8976
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

 Conflicts:
	test/parallel/test-url.js
@jun-oka jun-oka deleted the test-url-coverage branch October 26, 2016 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests. url Issues and PRs related to the legacy built-in url module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants