xref: /third_party/node/test/parallel/test-stream-duplex-props.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_cirequire('../common');
41cb0ef41Sopenharmony_ciconst assert = require('assert');
51cb0ef41Sopenharmony_ciconst { Duplex } = require('stream');
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ci{
81cb0ef41Sopenharmony_ci  const d = new Duplex({
91cb0ef41Sopenharmony_ci    objectMode: true,
101cb0ef41Sopenharmony_ci    highWaterMark: 100
111cb0ef41Sopenharmony_ci  });
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ci  assert.strictEqual(d.writableObjectMode, true);
141cb0ef41Sopenharmony_ci  assert.strictEqual(d.writableHighWaterMark, 100);
151cb0ef41Sopenharmony_ci  assert.strictEqual(d.readableObjectMode, true);
161cb0ef41Sopenharmony_ci  assert.strictEqual(d.readableHighWaterMark, 100);
171cb0ef41Sopenharmony_ci}
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_ci{
201cb0ef41Sopenharmony_ci  const d = new Duplex({
211cb0ef41Sopenharmony_ci    readableObjectMode: false,
221cb0ef41Sopenharmony_ci    readableHighWaterMark: 10,
231cb0ef41Sopenharmony_ci    writableObjectMode: true,
241cb0ef41Sopenharmony_ci    writableHighWaterMark: 100
251cb0ef41Sopenharmony_ci  });
261cb0ef41Sopenharmony_ci
271cb0ef41Sopenharmony_ci  assert.strictEqual(d.writableObjectMode, true);
281cb0ef41Sopenharmony_ci  assert.strictEqual(d.writableHighWaterMark, 100);
291cb0ef41Sopenharmony_ci  assert.strictEqual(d.readableObjectMode, false);
301cb0ef41Sopenharmony_ci  assert.strictEqual(d.readableHighWaterMark, 10);
311cb0ef41Sopenharmony_ci}
32

Indexes created Thu Nov 07 10:32:03 CST 2024