node/test/addons/errno-exception/test.js
Daniel Bevenius 95c8df18f1 test: add test to verify ErrnoException path
This commit adds a test to verify that the path argument to
ErrnoException can contain UTF-8 characters.

PR-URL: https://github.com/nodejs/node/pull/13958
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-14 07:24:22 +02:00

16 lines
468 B
JavaScript

'use strict';
const common = require('../../common');
// Verify that the path argument to node::ErrnoException() can contain UTF-8
// characters.
const assert = require('assert');
const binding = require(`./build/${common.buildType}/binding`);
const err = binding.errno();
assert.strictEqual(err.syscall, 'syscall');
assert.strictEqual(err.errno, 10);
assert.strictEqual(err.path, 'päth');
assert.ok(/^Error:\s\w+, some error msg 'päth'$/.test(err.toString()));