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

Chore: Updated no-control-regex tests to cover all cases (fixes #6438) #6752

Merged
merged 1 commit into from Jul 28, 2016
Merged

Chore: Updated no-control-regex tests to cover all cases (fixes #6438) #6752

merged 1 commit into from Jul 28, 2016

Conversation

efegurkan
Copy link
Contributor

What issue does this pull request address?
#6438

What changes did you make? (Give an overview)
toString prints out different outputs for /\x01/ and "/\x01/". Because
of that behavior, no-control-regex rule was broken before(fixed on 141b778).

During the fix for #5737 I added a test to cover the case I wrote for fix. Which
was also passing when the fix was not there. The test was on a string
literal unfortunately which was not covering the test case where regex
is written on a literal (like /\x01/). Changed the tests to make sure it
covers the literal regex's as expected.

Is there anything you'd like reviewers to focus on?

@mention-bot
Copy link

@efegurkan, thanks for your PR! By analyzing the annotation information on this pull request, we identified @ilyavolodin, @nzakas and @btmills to be potential reviewers

@eslintbot
Copy link

LGTM

@ljharb
Copy link
Sponsor Contributor

ljharb commented Jul 24, 2016

Thank you!

@eslintbot
Copy link

LGTM

@ilyavolodin
Copy link
Member

LGTM, but waiting another day for others to look

@@ -20,16 +20,17 @@ var ruleTester = new RuleTester();

ruleTester.run("no-control-regex", rule, {
valid: [
"var regex = /x1f/",
"var regex =" + /x1f/,
Copy link
Member

Choose a reason for hiding this comment

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

Why is this written as a string concat? This is a constant value, just write the string out.

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 changed it as a mistake, fixing and pushing it.

toString prints out different outputs for /\x01/ and "/\x01/". Because
of that behavior, no-control-regex rule was broken before(fixed on 141b778).

During the fix I added a test to cover the case I wrote for fix. Which
was also passing when the fix was not there. The test was on a string
literal unfortunately which was not covering the test case where regex
is written on a literal (like /\x01/). Changed the tests to make sure it
covers the literal regex's as expected.
@eslintbot
Copy link

LGTM

@gyandeeps gyandeeps merged commit ddea63a into eslint:master Jul 28, 2016
@ljharb
Copy link
Sponsor Contributor

ljharb commented Jul 28, 2016

Thanks!

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants