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: add test for invalid cert string #8179

Closed
wants to merge 2 commits into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Aug 19, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test tls

Description of change

tls.parseCertString() should return an empty object if passed an
invalid cert string. This behavior is not currently tested. Add minimal
test.

`tls.parseCertString()` should return an empty object if passed an
invalid cert string. This behavior is not currently tested. Add minimal
test.
@Trott Trott added tls Issues and PRs related to the tls subsystem. test Issues and PRs related to the tests. labels Aug 19, 2016

const invalid = 'fhqwhgads';
const invalidOut = tls.parseCertString(invalid);
assert.deepStrictEqual(invalidOut, {});
Copy link
Contributor

Choose a reason for hiding this comment

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

Add brackets to scope the above statements?

@bnoordhuis
Copy link
Member

LGTM with or without scoping. The rest of the test doesn't do it, it's not out of character.

@cjihrig
Copy link
Contributor

cjihrig commented Aug 19, 2016

LGTM

@Fishrock123
Copy link
Contributor

LGTM with CI: https://ci.nodejs.org/job/node-test-pull-request/3749/

Scoping is nice.

@Trott
Copy link
Member Author

Trott commented Aug 19, 2016

I prefer scoped consts in the tests over unscoped, but also favor small diffs over adding-stuff-just-because-I-can. The inner tension is TOO MUCH!!!!

OK, I added scopes! h/t @yorkie @Fishrock123

Re-running CI: https://ci.nodejs.org/job/node-test-pull-request/3753/

@yorkie
Copy link
Contributor

yorkie commented Aug 19, 2016

LGTM with scoped commit if CI is happy :p

@Trott
Copy link
Member Author

Trott commented Aug 19, 2016

@jbergstroem test/arm passed an hour ago but the GH widget thing still says "pending". It had previously failed. So maybe the bug is specific to re-running CI?

@Trott
Copy link
Member Author

Trott commented Aug 19, 2016

@jbergstroem Whoops! Nope! I'm wrong, it actually is still running. The Details link opens the wrong page, I think.

@Trott
Copy link
Member Author

Trott commented Aug 19, 2016

@jbergstroem
Copy link
Member

@Trott I think the path for fanned jobs might be incorrect. Might be racy -- I'll add it to my todo.

Trott added a commit to Trott/io.js that referenced this pull request Aug 22, 2016
`tls.parseCertString()` should return an empty object if passed an
invalid cert string. This behavior is not currently tested. Add minimal
test.

PR-URL: nodejs#8179
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
@Trott
Copy link
Member Author

Trott commented Aug 22, 2016

Landed in 12d7a50

@Trott Trott closed this Aug 22, 2016
evanlucas pushed a commit that referenced this pull request Aug 24, 2016
`tls.parseCertString()` should return an empty object if passed an
invalid cert string. This behavior is not currently tested. Add minimal
test.

PR-URL: #8179
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
@Trott Trott deleted the invalid-cert-string branch January 13, 2022 22:44
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. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants