Skip to content

Conversation

@nathansmile
Copy link
Contributor

replace string concatenation in test/parallel/test-icu-data-dir.js with template literals

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

@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Jul 18, 2017
constexpected=
'could not initialize ICU (check NODE_ICU_DATA or '+
'--icu-data-dir parameters)'+(common.isWindows ? '\r\n' : '\n');
`--icu-data-dir parameters)${common.isWindows ? '\r\n' : '\n'}`;
Copy link
Member

@gibfahngibfahnJul 18, 2017

Choose a reason for hiding this comment

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

While you're here, could you replace ${common.isWindows ? '\r\n' : '\n'} with ${os.EOL} (you'll have to const os = require('os') after line 2 as well)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually since expected is later used with str.includes(expected) you could remove the EOL completely, and fit the string in a single line.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@gibfahn sure, it will come soon~

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@refack Sorry, I can't get your meanings. Do you mean the code afterconst expected ... to be one line?

Copy link
Member

@gibfahngibfahnJul 20, 2017

Choose a reason for hiding this comment

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

@refack means this:

- '--icu-data-dir parameters)' + (common.isWindows ? '\r\n' : '\n');+ '--icu-data-dir parameters)'

but it was fine as it is (and arguably slightly better).

Copy link
Contributor

Choose a reason for hiding this comment

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

@nathansmile sorry I missed your comment. But I landed it since it's good. 😄

@refack
Copy link
Contributor

@nathansmile thank you for the contribution. Hope you follow up on this and make it even better 👍

@refackrefack self-assigned this Jul 18, 2017
@TrottTrott added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Jul 19, 2017
@joyeecheung
Copy link
Member

@nathansmile I think @refack meant since expected is tested with str.includes, we do not actually expect an exact match here so the test should still pass without an EOL at the end of expected. Although I think it still does not fit into one single line after dropping the EOL..

@joyeecheung
Copy link
Member

BTW personally I think we should keep the EOL in expected because we would actually want to make sure there is a line break here...otherwise the output might look a bit awkward.

Copy link
Member

@joyeecheungjoyeecheung 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 green

@joyeecheung
Copy link
Member

Copy link
Member

@TrottTrott 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 green

Copy link
Member

@TrottTrott 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 green.

refack pushed a commit to refack/node that referenced this pull request Jul 19, 2017
PR-URL: nodejs#14342 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
@refack
Copy link
Contributor

Landed in 01eddd9

@refackrefack closed this Jul 19, 2017
addaleax pushed a commit that referenced this pull request Jul 22, 2017
PR-URL: #14342 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Fishrock123 pushed a commit that referenced this pull request Jul 24, 2017
PR-URL: #14342 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
@addaleaxaddaleax mentioned this pull request Jul 24, 2017
@addaleaxaddaleax mentioned this pull request Aug 2, 2017
@refackrefack removed their assignment Oct 20, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-and-learnIssues related to the Code-and-Learn events and PRs submitted during the events.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@nathansmile@refack@joyeecheung@jasnell@Trott@gibfahn@MylesBorins@nodejs-github-bot