From 6fb49429e4352c6d12bf073019ff45b26938eb54 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. Refs: https://github.com/nodejs/node/pull/11129 --- 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 570e07dc8d5c00..83a70bfaf4d6b5 100644 --- a/node.gyp +++ b/node.gyp @@ -97,6 +97,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, '✓');