xref: /third_party/node/test/parallel/test-buffer-isencoding.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_ci
61cb0ef41Sopenharmony_ci[
71cb0ef41Sopenharmony_ci  'hex',
81cb0ef41Sopenharmony_ci  'utf8',
91cb0ef41Sopenharmony_ci  'utf-8',
101cb0ef41Sopenharmony_ci  'ascii',
111cb0ef41Sopenharmony_ci  'latin1',
121cb0ef41Sopenharmony_ci  'binary',
131cb0ef41Sopenharmony_ci  'base64',
141cb0ef41Sopenharmony_ci  'base64url',
151cb0ef41Sopenharmony_ci  'ucs2',
161cb0ef41Sopenharmony_ci  'ucs-2',
171cb0ef41Sopenharmony_ci  'utf16le',
181cb0ef41Sopenharmony_ci  'utf-16le',
191cb0ef41Sopenharmony_ci].forEach((enc) => {
201cb0ef41Sopenharmony_ci  assert.strictEqual(Buffer.isEncoding(enc), true);
211cb0ef41Sopenharmony_ci});
221cb0ef41Sopenharmony_ci
231cb0ef41Sopenharmony_ci[
241cb0ef41Sopenharmony_ci  'utf9',
251cb0ef41Sopenharmony_ci  'utf-7',
261cb0ef41Sopenharmony_ci  'Unicode-FTW',
271cb0ef41Sopenharmony_ci  'new gnu gun',
281cb0ef41Sopenharmony_ci  false,
291cb0ef41Sopenharmony_ci  NaN,
301cb0ef41Sopenharmony_ci  {},
311cb0ef41Sopenharmony_ci  Infinity,
321cb0ef41Sopenharmony_ci  [],
331cb0ef41Sopenharmony_ci  1,
341cb0ef41Sopenharmony_ci  0,
351cb0ef41Sopenharmony_ci  -1,
361cb0ef41Sopenharmony_ci].forEach((enc) => {
371cb0ef41Sopenharmony_ci  assert.strictEqual(Buffer.isEncoding(enc), false);
381cb0ef41Sopenharmony_ci});
39

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