0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/test/parallel/test-require-nul.js
Rich Trott 5e00a013eb lib,test: lint fixes for linter upgrade
ESLint 4.19.1 fixes some bugs in rules. These changes prepare us for the
upgrade.

PR-URL: https://github.com/nodejs/node/pull/19528
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-24 04:11:40 -07:00

12 lines
410 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
// Nul bytes should throw, not abort.
/* eslint-disable no-control-regex */
assert.throws(() => require('\u0000ab'), /Cannot find module '\u0000ab'/);
assert.throws(() => require('a\u0000b'), /Cannot find module 'a\u0000b'/);
assert.throws(() => require('ab\u0000'), /Cannot find module 'ab\u0000'/);
/* eslint-enable no-control-regex */