node/test/pseudo-tty/test-tty-wrap.js

14 lines
413 B
JavaScript
Raw Normal View History

// Flags: --expose-internals --no-warnings
'use strict';
require('../common');
2011-09-21 04:38:07 +08:00
const { internalBinding } = require('internal/test/binding');
const { TTY } = internalBinding('tty_wrap');
const { WriteWrap } = internalBinding('stream_wrap');
2011-09-21 04:38:07 +08:00
const handle = new TTY(1);
const req = new WriteWrap();
2011-09-21 04:38:07 +08:00
handle.writeBuffer(req, Buffer.from('hello world 1\n'));
handle.writeBuffer(req, Buffer.from('hello world 2\n'));