GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: fix broken tests in test-buffer-includes · nodejs/node@e2279e2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-buffer-includes.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-buffer-includes.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-buffer-includes.js
+10-12Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,12 @@ assert(mixedByteStringUcs2.includes('bc', 0, 'ucs2'));
155155
assert(mixedByteStringUcs2.includes('\u03a3', 0, 'ucs2'));
156156
assert(!mixedByteStringUcs2.includes('\u0396', 0, 'ucs2'));
157157

158-
assert(
159-
6, mixedByteStringUcs2.includes(Buffer.from('bc', 'ucs2'), 0, 'ucs2'));
160-
assert(
161-
10, mixedByteStringUcs2.includes(Buffer.from('\u03a3', 'ucs2'),
162-
0, 'ucs2'));
163-
assert(
164-
-1, mixedByteStringUcs2.includes(Buffer.from('\u0396', 'ucs2'),
165-
0, 'ucs2'));
158+
assert.ok(
159+
mixedByteStringUcs2.includes(Buffer.from('bc', 'ucs2'), 0, 'ucs2'));
160+
assert.ok(
161+
mixedByteStringUcs2.includes(Buffer.from('\u03a3', 'ucs2'), 0, 'ucs2'));
162+
assert.ok(
163+
!mixedByteStringUcs2.includes(Buffer.from('\u0396', 'ucs2'), 0, 'ucs2'));
166164

167165
twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2');
168166

@@ -266,12 +264,12 @@ for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
266264

267265
const patternBufferUcs2 =
268266
allCharsBufferUcs2.slice(index, index + length);
269-
assert(
270-
index, allCharsBufferUcs2.includes(patternBufferUcs2, 0, 'ucs2'));
267+
assert.ok(
268+
allCharsBufferUcs2.includes(patternBufferUcs2, 0, 'ucs2'));
271269

272270
const patternStringUcs2 = patternBufferUcs2.toString('ucs2');
273-
assert(
274-
index, allCharsBufferUcs2.includes(patternStringUcs2, 0, 'ucs2'));
271+
assert.ok(
272+
allCharsBufferUcs2.includes(patternStringUcs2, 0, 'ucs2'));
275273
}
276274
}
277275

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.