You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const common = require('../common');
|
|
|
|
const assert = require('assert');
|
|
|
|
const path = require('path');
|
|
|
|
const repl = require('repl');
|
|
|
|
let found = false;
|
|
|
|
|
|
|
|
process.on('exit', () => {
|
|
|
|
assert.strictEqual(found, true);
|
|
|
|
});
|
|
|
|
|
|
|
|
common.ArrayStream.prototype.write = function(output) {
|
|
|
|
if (/var foo bar;/.test(output))
|
|
|
|
found = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
const putIn = new common.ArrayStream();
|
|
|
|
repl.start('', putIn);
|
|
|
|
let file = path.resolve(__dirname, '../fixtures/syntax/bad_syntax');
|
|
|
|
|
|
|
|
if (common.isWindows)
|
|
|
|
file = file.replace(/\\/g, '\\\\');
|
|
|
|
|
|
|
|
putIn.run(['.clear']);
|
|
|
|
putIn.run([`require('${file}');`]);
|