summaryrefslogtreecommitdiff
path: root/test/parallel/test-require-nul.js
blob: 7756a2d4e2db1e01ce454cc6b1868b076f8598b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
'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 */