Skip to content

Non-ASCII character support - #45736

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mertcanaltin:bug-45706
Feb 18, 2023
Merged

Non-ASCII character support#45736
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mertcanaltin:bug-45706

Conversation

@mertcanaltin

@mertcanaltinmertcanaltin commented Dec 4, 2022

Copy link
Copy Markdown
Member

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

mertcanaltin commented Dec 4, 2022

Copy link
Copy Markdown
MemberAuthor

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

Comment threadlib/internal/test_runner/tap_lexer.js Outdated
Comment threadlib/internal/test_runner/tap_lexer.js Outdated
Comment threadtest/parallel/test-runner-tap-lexer.js Outdated
@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
Copy Markdown
MemberAuthor

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

Comment threadtest/parallel/test-runner-tap-lexer.js Outdated
Comment threadlib/internal/test_runner/tap_lexer.js Outdated
Comment threadlib/internal/test_runner/tap_lexer.js Outdated
Comment threadlib/internal/test_runner/tap_lexer.js Outdated
Comment threadlib/internal/test_runner/tap_lexer.js Outdated
@anonrig
anonrig requested a review from MoLowDecember 4, 2022 23:03
@anonrig

Copy link
Copy Markdown
Member

@manekinekko Can you review this?

@MoLowMoLow left a comment

Copy link
Copy Markdown
Member

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

Comment threadlib/internal/test_runner/tap_lexer.js Outdated

Copy link
Copy Markdown
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
Copy Markdown
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 🚀

@mertcanaltinmertcanaltinDec 5, 2022

Copy link
Copy Markdown
MemberAuthor

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);});}

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

Copy link
Copy Markdown
MemberAuthor

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

Comment threadlib/internal/test_runner/tap_lexer.js Outdated
Comment threadlib/internal/test_runner/tap_lexer.js Outdated
Comment threadtest/parallel/test-runner-tap-lexer.js Outdated
@mertcanaltin

Copy link
Copy Markdown
MemberAuthor

@manekinekko I sent the edits thank you very much

@BridgeARBridgeAR left a comment

Copy link
Copy Markdown
Member

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

mertcanaltin commented Dec 7, 2022

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
Contributor

@mertcanaltin I think that would be ok.

@MoLow

MoLow commented Feb 8, 2023

Copy link
Copy Markdown
Member

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

@MoLow

MoLow commented Feb 8, 2023

Copy link
Copy Markdown
Member

@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
Copy Markdown
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-bot
nodejs-github-bot merged commit 3c6547f into nodejs:mainFeb 18, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 3c6547f

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

Copy link
Copy Markdown
MemberAuthor

🎉

MylesBorins pushed a commit that referenced this pull request Feb 18, 2023
PR-URL: #45736
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
@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 <yagiz@nizipli.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
MoLow pushed a commit to MoLow/node that referenced this pull request Feb 25, 2023
PR-URL: nodejs#45736
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
juanarbol pushed a commit that referenced this pull request Mar 3, 2023
PR-URL: #45736
Backport-PR-URL: #46839
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
@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 <yagiz@nizipli.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
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