Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aa8771f

Browse filesBrowse files
watildeItalo A. Casas
authored andcommitted
test: use common.hasIntl in tests related to ICU
We should use `common.hasIntl` in tests for test cases which are related to ICU. This way we can easily find the test cases that are Intl dependent. Plus, it will be able to make the tests a little faster if we check hasIntl first. Also, this tweaks the log messages to unify the message. Refs: #10707 PR-URL: #10841 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 2641cd4 commit aa8771f
Copy full SHA for aa8771f

File tree

Expand file treeCollapse file tree

6 files changed

+18
-18
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

6 files changed

+18
-18
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-icu-punycode.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-icu-punycode.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
'use strict';
2-
32
const common = require('../common');
3+
4+
if (!common.hasIntl) {
5+
common.skip('missing Intl');
6+
return;
7+
}
8+
49
const icu = getPunycode();
510
const assert = require('assert');
611

@@ -12,11 +17,6 @@ function getPunycode() {
1217
}
1318
}
1419

15-
if (!icu) {
16-
common.skip('icu punycode tests because ICU is not present.');
17-
return;
18-
}
19-
2020
// Credit for list: http://www.i18nguy.com/markup/idna-examples.html
2121
const tests = [
2222
'افغانستا.icom.museum',
Collapse file

‎test/parallel/test-icu-stringwidth.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-icu-stringwidth.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// Flags: --expose_internals
22
'use strict';
3-
43
const common = require('../common');
5-
const assert = require('assert');
6-
const readline = require('internal/readline');
74

8-
if (!process.binding('config').hasIntl) {
9-
common.skip('missing intl... skipping test');
5+
if (!common.hasIntl) {
6+
common.skip('missing Intl');
107
return;
118
}
129

10+
const assert = require('assert');
11+
const readline = require('internal/readline');
12+
1313
// Test column width
1414
assert.strictEqual(readline.getStringWidth('a'), 1);
1515
assert.strictEqual(readline.getStringWidth('丁'), 2);
Collapse file

‎test/parallel/test-icu-transcode.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-icu-transcode.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
'use strict';
22

33
const common = require('../common');
4-
const buffer = require('buffer');
5-
const assert = require('assert');
64

75
if (!common.hasIntl) {
8-
common.skip('icu punycode tests because ICU is not present.');
6+
common.skip('missing Intl');
97
return;
108
}
119

10+
const buffer = require('buffer');
11+
const assert = require('assert');
1212
const orig = Buffer.from('tést €', 'utf8');
1313

1414
// Test Transcoding
Collapse file

‎test/parallel/test-intl-v8BreakIterator.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-intl-v8BreakIterator.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use strict';
22
const common = require('../common');
3-
const assert = require('assert');
43

54
if (!common.hasIntl || Intl.v8BreakIterator === undefined) {
6-
return common.skip('no Intl');
5+
return common.skip('missing Intl');
76
}
87

8+
const assert = require('assert');
99
const warning = 'Intl.v8BreakIterator is deprecated and will be removed soon.';
1010
common.expectWarning('DeprecationWarning', warning);
1111

Collapse file

‎test/parallel/test-whatwg-url-parsing.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-whatwg-url-parsing.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const common = require('../common');
44

55
if (!common.hasIntl) {
66
// A handful of the tests fail when ICU is not included.
7-
common.skip('missing Intl... skipping test');
7+
common.skip('missing Intl');
88
return;
99
}
1010

Collapse file

‎test/parallel/test-whatwg-url-setters.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-whatwg-url-setters.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const common = require('../common');
44

55
if (!common.hasIntl) {
66
// A handful of the tests fail when ICU is not included.
7-
common.skip('missing Intl... skipping test');
7+
common.skip('missing Intl');
88
return;
99
}
1010

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.