From 8caf6fd58a308dd4312cd25031050f76af4a7ca6 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Thu, 16 Feb 2017 20:26:10 +0200 Subject: [PATCH] test: add Unicode characters regression test This test ensures that UTF-8 characters can be used in core JavaScript modules built into Node's binary. PR-URL: https://github.com/nodejs/node/pull/11423 Ref: https://github.com/nodejs/node/pull/11129 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis Reviewed-By: Sakthipriyan Vairamani Reviewed-By: James M Snell --- lib/internal/test/unicode.js | 6 ++++++ node.gyp | 1 + test/parallel/test-internal-unicode.js | 12 ++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 lib/internal/test/unicode.js create mode 100644 test/parallel/test-internal-unicode.js 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, '✓');