Skip to content

Conversation

@mertcanaltin
Copy link
Member

@mertcanaltinmertcanaltin commented Dec 4, 2022

Fixes#45706
Fixes#46508

  • Is the character's ASCII code greater than 127? (In this case, the function returns true)
  • Is the character a number? (In this case, the function returns false)
  • Is the character a "#" symbol? (In this case, the function returns false)
  • If no conditions are met, the function returns true.

@nodejs-github-botnodejs-github-bot added dont-land-on-v14.x needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Dec 4, 2022
@mertcanaltin
Copy link
MemberAuthor

mertcanaltin commented Dec 4, 2022

test

constisLiteralSymbol=(char)=>{constcode=char.charCodeAt(0);if(code>127){returntrue;}if(char>='0'&&char<=9){returnfalse;}if(code===35){returnfalse;}returntrue;}

output

isLiteralSymbol('أهلا')true

@anonriganonrig added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Dec 4, 2022
@mertcanaltin
Copy link
MemberAuthor

@anonrig I applied the changes, thank you very much for the review 🚀

@anonriganonrig requested a review from MoLowDecember 4, 2022 23:03
@anonrig
Copy link
Member

@manekinekko Can you review this?

Copy link
Member

@MoLowMoLow left a comment

Choose a reason for hiding this comment

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

the change LGTM, but this seems to break quite a few tests

assert.strictEqual(isLiteralSymbol('#'),false);
assert.strictEqual(isLiteralSymbol('أ'),true);
assert.strictEqual(isLiteralSymbol('ت'),true);
assert.strictEqual(isLiteralSymbol('ث'),true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you:

  1. group these into 2 groups: literals (true) and non-literals (false)?
  2. add more samples of non-Latin characters? you can cherry-pick from this list here.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@manekinekko thank you so much i will fly here 🚀

Copy link
MemberAuthor

@mertcanaltinmertcanaltinDec 5, 2022

Choose a reason for hiding this comment

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

@manekinekko would that be healthy

{constliterals=['A','a','-','+','أ','ت','ث','讲','演','講'];constnonLiterals=['0','#','\\','+','-'];literals.forEach((literal)=>{assert.strictEqual(isLiteralSymbol(literal),true);});nonLiterals.forEach((nonLiteral)=>{assert.strictEqual(isLiteralSymbol(nonLiteral),false);});}

@mertcanaltinmertcanaltin requested review from MoLow, anonrig and manekinekko and removed request for MoLow, anonrig and manekinekkoDecember 5, 2022 14:59
@mertcanaltin
Copy link
MemberAuthor

I'm so sorry I triggered you all to review, sorry for the extra notifications :/

@mertcanaltin
Copy link
MemberAuthor

@manekinekko I sent the edits thank you very much

Copy link
Member

@BridgeARBridgeAR left a comment

Choose a reason for hiding this comment

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

Should we really accept zero width characters as acceptable input? I would skip all of them. We also already have a function to check for these:

constisZeroWidthCodePoint=(code)=>{
returncode<=0x1F||// C0 control codes
(code>=0x7F&&code<=0x9F)||// C1 control codes
(code>=0x300&&code<=0x36F)||// Combining Diacritical Marks
(code>=0x200B&&code<=0x200F)||// Modifying Invisible Characters
// Combining Diacritical Marks for Symbols
(code>=0x20D0&&code<=0x20FF)||
(code>=0xFE00&&code<=0xFE0F)||// Variation Selectors
(code>=0xFE20&&code<=0xFE2F)||// Combining Half Marks
(code>=0xE0100&&code<=0xE01EF);// Variation Selectors
};

@mertcanaltin
Copy link
MemberAuthor

mertcanaltin commented Dec 7, 2022

I didn't accept zero-width characters @BridgeAR i will update the code like this

if(typeofchar!=='string'||util.inspect.isZeroWidthCodePoint(char)){returnfalse;}

can I do it like this?

@cjihrig
Copy link
Contributor

@mertcanaltin I think that would be ok.

@MoLow
Copy link
Member

MoLow commented Feb 8, 2023

CC @nodejs/test_runner @manekinekko additional reviews will be appreciated

@MoLow
Copy link
Member

MoLow commented Feb 8, 2023

@anonrig can you please dismiss your review/approve?

@MoLowMoLow removed the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Feb 8, 2023
@MoLowMoLow added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Feb 9, 2023
@MoLowMoLow added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 18, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 18, 2023
@nodejs-github-bot
Copy link
Collaborator

@MoLowMoLow added the commit-queue Add this label to land a pull request using GitHub Actions. label Feb 18, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Feb 18, 2023
@nodejs-github-botnodejs-github-bot merged commit 3c6547f into nodejs:mainFeb 18, 2023
@nodejs-github-bot
Copy link
Collaborator

Landed in 3c6547f

@mertcanaltinmertcanaltin changed the title [WIP] Non-ASCII character supportNon-ASCII character supportFeb 18, 2023
@mertcanaltin
Copy link
MemberAuthor

🎉

MoLow pushed a commit to MoLow/node that referenced this pull request Feb 18, 2023
PR-URL: nodejs#45736 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
MylesBorins pushed a commit that referenced this pull request Feb 18, 2023
PR-URL: #45736 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request Feb 19, 2023
MylesBorins pushed a commit that referenced this pull request Feb 20, 2023
PR-URL: #45736 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
MoLow pushed a commit to MoLow/node that referenced this pull request Feb 25, 2023
PR-URL: nodejs#45736 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
MoLow pushed a commit to MoLow/node that referenced this pull request Feb 25, 2023
PR-URL: nodejs#45736 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
MoLow pushed a commit to MoLow/node that referenced this pull request Feb 25, 2023
PR-URL: nodejs#45736 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
juanarbol pushed a commit that referenced this pull request Mar 3, 2023
PR-URL: #45736 Backport-PR-URL: #46839 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
@juanarboljuanarbol mentioned this pull request Mar 3, 2023
juanarbol pushed a commit that referenced this pull request Mar 5, 2023
PR-URL: #45736 Backport-PR-URL: #46839 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ciPRs that need a full CI run.test_runnerIssues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test runner regression in 19.2.0 Tap parser fails when test name includes non ASCII characters

9 participants

@mertcanaltin@anonrig@cjihrig@jtuchel@MoLow@nodejs-github-bot@manekinekko@BridgeAR@aduh95