diff --git a/lib/internal/test/unicode.js b/lib/internal/test/unicode.js new file mode 100644 index 00000000000000..1445276d9ae891 --- /dev/null +++ b/lib/internal/test/unicode.js @@ -0,0 +1,6 @@ +'use strict'; + +// This module exists entirely for regression testing purposes. +// See `test/parallel/test-internal-unicode.js`. + +module.exports = '✓'; diff --git a/node.gyp b/node.gyp index c12fb4c0cf79f4..935b0e7195d3ba 100644 --- a/node.gyp +++ b/node.gyp @@ -98,6 +98,7 @@ 'lib/internal/readline.js', 'lib/internal/repl.js', 'lib/internal/socket_list.js', + 'lib/internal/test/unicode.js', 'lib/internal/url.js', 'lib/internal/util.js', 'lib/internal/v8_prof_polyfill.js', diff --git a/test/parallel/test-internal-unicode.js b/test/parallel/test-internal-unicode.js new file mode 100644 index 00000000000000..0a36309c09f651 --- /dev/null +++ b/test/parallel/test-internal-unicode.js @@ -0,0 +1,12 @@ +'use strict'; +require('../common'); + +// Flags: --expose-internals +// +// This test ensures that UTF-8 characters can be used in core JavaScript +// libraries built into Node's binary. + +const assert = require('assert'); +const character = require('internal/test/unicode'); + +assert.strictEqual(character, '✓');