GeezerVison is showing github.com — test: fix broken tests in test-buffer-includes · nodejs/node@e2279e2
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-buffer-includes.js +10-12Lines changed: 10 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -155,14 +155,12 @@ assert(mixedByteStringUcs2.includes('bc', 0, 'ucs2')); | 155 | 155 | assert(mixedByteStringUcs2.includes('\u03a3', 0, 'ucs2')); | 156 | 156 | assert(!mixedByteStringUcs2.includes('\u0396', 0, 'ucs2')); | 157 | 157 |
| 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')); | 166 | 164 |
| 167 | 165 | twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2'); | 168 | 166 |
| @@ -266,12 +264,12 @@ for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) { | 266 | 264 |
| 267 | 265 | const patternBufferUcs2 = | 268 | 266 | allCharsBufferUcs2.slice(index, index + length); | 269 | | - assert( | 270 | | - index, allCharsBufferUcs2.includes(patternBufferUcs2, 0, 'ucs2')); | | 267 | + assert.ok( | | 268 | + allCharsBufferUcs2.includes(patternBufferUcs2, 0, 'ucs2')); | 271 | 269 |
| 272 | 270 | const patternStringUcs2 = patternBufferUcs2.toString('ucs2'); | 273 | | - assert( | 274 | | - index, allCharsBufferUcs2.includes(patternStringUcs2, 0, 'ucs2')); | | 271 | + assert.ok( | | 272 | + allCharsBufferUcs2.includes(patternStringUcs2, 0, 'ucs2')); | 275 | 273 | } | 276 | 274 | } | 277 | 275 |
| |
|