Lines Matching refs:strictEqual
14 assert.strictEqual(b.indexOf('a'), 0);
15 assert.strictEqual(b.indexOf('a', 1), -1);
16 assert.strictEqual(b.indexOf('a', -1), -1);
17 assert.strictEqual(b.indexOf('a', -4), -1);
18 assert.strictEqual(b.indexOf('a', -b.length), 0);
19 assert.strictEqual(b.indexOf('a', NaN), 0);
20 assert.strictEqual(b.indexOf('a', -Infinity), 0);
21 assert.strictEqual(b.indexOf('a', Infinity), -1);
22 assert.strictEqual(b.indexOf('bc'), 1);
23 assert.strictEqual(b.indexOf('bc', 2), -1);
24 assert.strictEqual(b.indexOf('bc', -1), -1);
25 assert.strictEqual(b.indexOf('bc', -3), -1);
26 assert.strictEqual(b.indexOf('bc', -5), 1);
27 assert.strictEqual(b.indexOf('bc', NaN), 1);
28 assert.strictEqual(b.indexOf('bc', -Infinity), 1);
29 assert.strictEqual(b.indexOf('bc', Infinity), -1);
30 assert.strictEqual(b.indexOf('f'), b.length - 1);
31 assert.strictEqual(b.indexOf('z'), -1);
32 assert.strictEqual(b.indexOf(''), 0);
33 assert.strictEqual(b.indexOf('', 1), 1);
34 assert.strictEqual(b.indexOf('', b.length + 1), b.length);
35 assert.strictEqual(b.indexOf('', Infinity), b.length);
36 assert.strictEqual(b.indexOf(buf_a), 0);
37 assert.strictEqual(b.indexOf(buf_a, 1), -1);
38 assert.strictEqual(b.indexOf(buf_a, -1), -1);
39 assert.strictEqual(b.indexOf(buf_a, -4), -1);
40 assert.strictEqual(b.indexOf(buf_a, -b.length), 0);
41 assert.strictEqual(b.indexOf(buf_a, NaN), 0);
42 assert.strictEqual(b.indexOf(buf_a, -Infinity), 0);
43 assert.strictEqual(b.indexOf(buf_a, Infinity), -1);
44 assert.strictEqual(b.indexOf(buf_bc), 1);
45 assert.strictEqual(b.indexOf(buf_bc, 2), -1);
46 assert.strictEqual(b.indexOf(buf_bc, -1), -1);
47 assert.strictEqual(b.indexOf(buf_bc, -3), -1);
48 assert.strictEqual(b.indexOf(buf_bc, -5), 1);
49 assert.strictEqual(b.indexOf(buf_bc, NaN), 1);
50 assert.strictEqual(b.indexOf(buf_bc, -Infinity), 1);
51 assert.strictEqual(b.indexOf(buf_bc, Infinity), -1);
52 assert.strictEqual(b.indexOf(buf_f), b.length - 1);
53 assert.strictEqual(b.indexOf(buf_z), -1);
54 assert.strictEqual(b.indexOf(buf_empty), 0);
55 assert.strictEqual(b.indexOf(buf_empty, 1), 1);
56 assert.strictEqual(b.indexOf(buf_empty, b.length + 1), b.length);
57 assert.strictEqual(b.indexOf(buf_empty, Infinity), b.length);
58 assert.strictEqual(b.indexOf(0x61), 0);
59 assert.strictEqual(b.indexOf(0x61, 1), -1);
60 assert.strictEqual(b.indexOf(0x61, -1), -1);
61 assert.strictEqual(b.indexOf(0x61, -4), -1);
62 assert.strictEqual(b.indexOf(0x61, -b.length), 0);
63 assert.strictEqual(b.indexOf(0x61, NaN), 0);
64 assert.strictEqual(b.indexOf(0x61, -Infinity), 0);
65 assert.strictEqual(b.indexOf(0x61, Infinity), -1);
66 assert.strictEqual(b.indexOf(0x0), -1);
69 assert.strictEqual(b.indexOf('d', 2), 3);
70 assert.strictEqual(b.indexOf('f', 5), 5);
71 assert.strictEqual(b.indexOf('f', -1), 5);
72 assert.strictEqual(b.indexOf('f', 6), -1);
74 assert.strictEqual(b.indexOf(Buffer.from('d'), 2), 3);
75 assert.strictEqual(b.indexOf(Buffer.from('f'), 5), 5);
76 assert.strictEqual(b.indexOf(Buffer.from('f'), -1), 5);
77 assert.strictEqual(b.indexOf(Buffer.from('f'), 6), -1);
79 assert.strictEqual(Buffer.from('ff').indexOf(Buffer.from('f'), 1, 'ucs2'), -1);
82 assert.strictEqual(b.indexOf('b', 'utf8'), 1);
83 assert.strictEqual(b.indexOf('b', 'UTF8'), 1);
84 assert.strictEqual(b.indexOf('62', 'HEX'), 1);
88 assert.strictEqual(
93 assert.strictEqual(
100 assert.strictEqual(
105 assert.strictEqual(
112 assert.strictEqual(
117 assert.strictEqual(
124 assert.strictEqual(
129 assert.strictEqual(
134 assert.strictEqual(
139 assert.strictEqual(
144 assert.strictEqual(
151 assert.strictEqual(
156 assert.strictEqual(
161 assert.strictEqual(
166 assert.strictEqual(
171 assert.strictEqual(
179 assert.strictEqual(Buffer.from('aaaa0').indexOf('30', 'hex'), 4);
180 assert.strictEqual(Buffer.from('aaaa00a').indexOf('3030', 'hex'), 4);
188 assert.strictEqual(twoByteString.indexOf('\u0395', 4, encoding), 8);
189 assert.strictEqual(twoByteString.indexOf('\u03a3', -4, encoding), 6);
190 assert.strictEqual(twoByteString.indexOf('\u03a3', -6, encoding), 4);
191 assert.strictEqual(twoByteString.indexOf(
193 assert.strictEqual(-1, twoByteString.indexOf('\u03a3', -2, encoding));
199 assert.strictEqual(mixedByteStringUcs2.indexOf('bc', 0, 'ucs2'), 6);
200 assert.strictEqual(mixedByteStringUcs2.indexOf('\u03a3', 0, 'ucs2'), 10);
201 assert.strictEqual(-1, mixedByteStringUcs2.indexOf('\u0396', 0, 'ucs2'));
203 assert.strictEqual(
205 assert.strictEqual(
207 assert.strictEqual(
214 assert.strictEqual(twoByteString.indexOf('\u039a', 0, 'ucs2'), 0);
216 assert.strictEqual(index, 2, `Alpha - at index ${index}`);
218 assert.strictEqual(index, 4, `First Sigma - at index ${index}`);
220 assert.strictEqual(index, 6, `Second Sigma - at index ${index}`);
222 assert.strictEqual(index, 8, `Epsilon - at index ${index}`);
224 assert.strictEqual(-1, index, `Not beta - at index ${index}`);
228 assert.strictEqual(index, 0, `Lambda Alpha - at index ${index}`);
230 assert.strictEqual(index, 2, `Alpha Sigma - at index ${index}`);
232 assert.strictEqual(index, 4, `Sigma Sigma - at index ${index}`);
234 assert.strictEqual(index, 6, `Sigma Epsilon - at index ${index}`);
238 assert.strictEqual(mixedByteStringUtf8.indexOf('bc'), 5);
239 assert.strictEqual(mixedByteStringUtf8.indexOf('bc', 5), 5);
240 assert.strictEqual(mixedByteStringUtf8.indexOf('bc', -8), 5);
241 assert.strictEqual(mixedByteStringUtf8.indexOf('\u03a3'), 7);
242 assert.strictEqual(mixedByteStringUtf8.indexOf('\u0396'), -1);
258 assert.strictEqual((i + 15) & ~0xf, index,
263 assert.strictEqual(index, 510, `Long AJABACA, First J - at index ${index}`);
265 assert.strictEqual(index, 1534, `Long AJABACA, Second J - at index ${index}`);
269 assert.strictEqual(index, 511, `Long JABACABA..., First J - at index ${index}`);
271 assert.strictEqual(
277 assert.strictEqual(-1, asciiString.indexOf('\x2061'));
278 assert.strictEqual(asciiString.indexOf('leb', 0), 3);
290 assert.strictEqual(-1, allCharsBufferUtf8.indexOf('notfound'));
291 assert.strictEqual(-1, allCharsBufferUcs2.indexOf('notfound'));
294 assert.strictEqual(Buffer.from('aaaa').indexOf('a'.repeat(4), 'ucs2'), -1);
296 assert.strictEqual(Buffer.from('aaaa').indexOf('a'.repeat(4), 'utf8'), 0);
297 assert.strictEqual(Buffer.from('aaaa').indexOf('你好', 'ucs2'), -1);
300 assert.strictEqual(Buffer.from('aaaaa').indexOf('b', 'ucs2'), -1);
324 assert.strictEqual(index, allCharsBufferUtf8.indexOf(patternBufferUtf8));
327 assert.strictEqual(index, allCharsBufferUtf8.indexOf(patternStringUtf8));
343 assert.strictEqual(
347 assert.strictEqual(
372 assert.strictEqual(b.indexOf('b', undefined), 1);
373 assert.strictEqual(b.indexOf('b', {}), 1);
374 assert.strictEqual(b.indexOf('b', 0), 1);
375 assert.strictEqual(b.indexOf('b', null), 1);
376 assert.strictEqual(b.indexOf('b', []), 1);
379 assert.strictEqual(b.indexOf('b', [2]), -1);
382 assert.strictEqual(
385 assert.strictEqual(
388 assert.strictEqual(
391 assert.strictEqual(
394 assert.strictEqual(
397 assert.strictEqual(
406 assert.strictEqual(b.lastIndexOf('a'), 0);
407 assert.strictEqual(b.lastIndexOf('a', 1), 0);
408 assert.strictEqual(b.lastIndexOf('b', 1), 1);
409 assert.strictEqual(b.lastIndexOf('c', 1), -1);
410 assert.strictEqual(b.lastIndexOf('a', -1), 0);
411 assert.strictEqual(b.lastIndexOf('a', -4), 0);
412 assert.strictEqual(b.lastIndexOf('a', -b.length), 0);
413 assert.strictEqual(b.lastIndexOf('a', -b.length - 1), -1);
414 assert.strictEqual(b.lastIndexOf('a', NaN), 0);
415 assert.strictEqual(b.lastIndexOf('a', -Infinity), -1);
416 assert.strictEqual(b.lastIndexOf('a', Infinity), 0);
418 assert.strictEqual(b.lastIndexOf(buf_a), 0);
419 assert.strictEqual(b.lastIndexOf(buf_a, 1), 0);
420 assert.strictEqual(b.lastIndexOf(buf_a, -1), 0);
421 assert.strictEqual(b.lastIndexOf(buf_a, -4), 0);
422 assert.strictEqual(b.lastIndexOf(buf_a, -b.length), 0);
423 assert.strictEqual(b.lastIndexOf(buf_a, -b.length - 1), -1);
424 assert.strictEqual(b.lastIndexOf(buf_a, NaN), 0);
425 assert.strictEqual(b.lastIndexOf(buf_a, -Infinity), -1);
426 assert.strictEqual(b.lastIndexOf(buf_a, Infinity), 0);
427 assert.strictEqual(b.lastIndexOf(buf_bc), 1);
428 assert.strictEqual(b.lastIndexOf(buf_bc, 2), 1);
429 assert.strictEqual(b.lastIndexOf(buf_bc, -1), 1);
430 assert.strictEqual(b.lastIndexOf(buf_bc, -3), 1);
431 assert.strictEqual(b.lastIndexOf(buf_bc, -5), 1);
432 assert.strictEqual(b.lastIndexOf(buf_bc, -6), -1);
433 assert.strictEqual(b.lastIndexOf(buf_bc, NaN), 1);
434 assert.strictEqual(b.lastIndexOf(buf_bc, -Infinity), -1);
435 assert.strictEqual(b.lastIndexOf(buf_bc, Infinity), 1);
436 assert.strictEqual(b.lastIndexOf(buf_f), b.length - 1);
437 assert.strictEqual(b.lastIndexOf(buf_z), -1);
438 assert.strictEqual(b.lastIndexOf(buf_empty), b.length);
439 assert.strictEqual(b.lastIndexOf(buf_empty, 1), 1);
440 assert.strictEqual(b.lastIndexOf(buf_empty, b.length + 1), b.length);
441 assert.strictEqual(b.lastIndexOf(buf_empty, Infinity), b.length);
443 assert.strictEqual(b.lastIndexOf(0x61), 0);
444 assert.strictEqual(b.lastIndexOf(0x61, 1), 0);
445 assert.strictEqual(b.lastIndexOf(0x61, -1), 0);
446 assert.strictEqual(b.lastIndexOf(0x61, -4), 0);
447 assert.strictEqual(b.lastIndexOf(0x61, -b.length), 0);
448 assert.strictEqual(b.lastIndexOf(0x61, -b.length - 1), -1);
449 assert.strictEqual(b.lastIndexOf(0x61, NaN), 0);
450 assert.strictEqual(b.lastIndexOf(0x61, -Infinity), -1);
451 assert.strictEqual(b.lastIndexOf(0x61, Infinity), 0);
452 assert.strictEqual(b.lastIndexOf(0x0), -1);
456 assert.strictEqual(b.lastIndexOf('b', undefined), 1);
457 assert.strictEqual(b.lastIndexOf('b', {}), 1);
460 assert.strictEqual(b.lastIndexOf('b', 0), -1);
461 assert.strictEqual(b.lastIndexOf('b', null), -1);
462 assert.strictEqual(b.lastIndexOf('b', []), -1);
465 assert.strictEqual(b.lastIndexOf('b', [2]), 1);
468 assert.strictEqual(
471 assert.strictEqual(
474 assert.strictEqual(
477 assert.strictEqual(
480 assert.strictEqual(
483 assert.strictEqual(
488 assert.strictEqual(b.lastIndexOf('aaaaaaaaaaaaaaa', 'ucs2'), -1);
489 assert.strictEqual(b.lastIndexOf('aaaaaaaaaaaaaaa', 'utf8'), -1);
490 assert.strictEqual(b.lastIndexOf('aaaaaaaaaaaaaaa', 'latin1'), -1);
491 assert.strictEqual(b.lastIndexOf('aaaaaaaaaaaaaaa', 'binary'), -1);
492 assert.strictEqual(b.lastIndexOf(Buffer.from('aaaaaaaaaaaaaaa')), -1);
493 assert.strictEqual(b.lastIndexOf('aaaaaaaaaaaaaaa', 2, 'ucs2'), -1);
494 assert.strictEqual(b.lastIndexOf('aaaaaaaaaaaaaaa', 3, 'utf8'), -1);
495 assert.strictEqual(b.lastIndexOf('aaaaaaaaaaaaaaa', 5, 'latin1'), -1);
496 assert.strictEqual(b.lastIndexOf('aaaaaaaaaaaaaaa', 5, 'binary'), -1);
497 assert.strictEqual(b.lastIndexOf(Buffer.from('aaaaaaaaaaaaaaa'), 7), -1);
500 assert.strictEqual(buf_bc.lastIndexOf('你好', 'ucs2'), -1);
501 assert.strictEqual(buf_bc.lastIndexOf('你好', 'utf8'), -1);
502 assert.strictEqual(buf_bc.lastIndexOf('你好', 'latin1'), -1);
503 assert.strictEqual(buf_bc.lastIndexOf('你好', 'binary'), -1);
504 assert.strictEqual(buf_bc.lastIndexOf(Buffer.from('你好')), -1);
505 assert.strictEqual(buf_bc.lastIndexOf('你好', 2, 'ucs2'), -1);
506 assert.strictEqual(buf_bc.lastIndexOf('你好', 3, 'utf8'), -1);
507 assert.strictEqual(buf_bc.lastIndexOf('你好', 5, 'latin1'), -1);
508 assert.strictEqual(buf_bc.lastIndexOf('你好', 5, 'binary'), -1);
509 assert.strictEqual(buf_bc.lastIndexOf(Buffer.from('你好'), 7), -1);
513 assert.strictEqual(bufferString.lastIndexOf('canal'), 15);
514 assert.strictEqual(bufferString.lastIndexOf('panama'), 21);
515 assert.strictEqual(bufferString.lastIndexOf('a man a plan a canal panama'), 0);
516 assert.strictEqual(-1, bufferString.lastIndexOf('a man a plan a canal mexico'));
517 assert.strictEqual(-1, bufferString
519 assert.strictEqual(-1, bufferString.lastIndexOf(Buffer.from('a'.repeat(1000))));
520 assert.strictEqual(bufferString.lastIndexOf('a man a plan', 4), 0);
521 assert.strictEqual(bufferString.lastIndexOf('a '), 13);
522 assert.strictEqual(bufferString.lastIndexOf('a ', 13), 13);
523 assert.strictEqual(bufferString.lastIndexOf('a ', 12), 6);
524 assert.strictEqual(bufferString.lastIndexOf('a ', 5), 0);
525 assert.strictEqual(bufferString.lastIndexOf('a ', -1), 13);
526 assert.strictEqual(bufferString.lastIndexOf('a ', -27), 0);
527 assert.strictEqual(-1, bufferString.lastIndexOf('a ', -28));
533 assert.strictEqual(-1, Buffer.from('µaaaa¶bbbb', 'latin1').lastIndexOf('µ'));
534 assert.strictEqual(-1, Buffer.from('µaaaa¶bbbb', 'binary').lastIndexOf('µ'));
535 assert.strictEqual(-1, Buffer.from('bc').lastIndexOf('ab'));
536 assert.strictEqual(-1, Buffer.from('abc').lastIndexOf('qa'));
537 assert.strictEqual(-1, Buffer.from('abcdef').lastIndexOf('qabc'));
538 assert.strictEqual(-1, Buffer.from('bc').lastIndexOf(Buffer.from('ab')));
539 assert.strictEqual(-1, Buffer.from('bc', 'ucs2').lastIndexOf('ab', 'ucs2'));
540 assert.strictEqual(-1, Buffer.from('bc', 'ucs2').lastIndexOf(abInUCS2));
542 assert.strictEqual(Buffer.from('abc').lastIndexOf('ab'), 0);
543 assert.strictEqual(Buffer.from('abc').lastIndexOf('ab', 1), 0);
544 assert.strictEqual(Buffer.from('abc').lastIndexOf('ab', 2), 0);
545 assert.strictEqual(Buffer.from('abc').lastIndexOf('ab', 3), 0);
551 assert.strictEqual(longBufferString.lastIndexOf(pattern), 1535);
552 assert.strictEqual(longBufferString.lastIndexOf(pattern, 1535), 1535);
553 assert.strictEqual(longBufferString.lastIndexOf(pattern, 1534), 511);
575 assert.strictEqual(reallyLong.slice(0, 19).toString(), 'yolo swag swag yolo');
579 assert.strictEqual(reallyLong.lastIndexOf(pattern), 4751360);
580 assert.strictEqual(reallyLong.lastIndexOf(pattern, 4000000), 3932160);
581 assert.strictEqual(reallyLong.lastIndexOf(pattern, 3000000), 2949120);
583 assert.strictEqual(reallyLong.lastIndexOf(pattern), 4728480);
585 assert.strictEqual(reallyLong.lastIndexOf(pattern), 3932160);
587 assert.strictEqual(reallyLong.lastIndexOf(pattern), 0);
592 assert.strictEqual(buf.indexOf(0x6973), 3);
593 assert.strictEqual(buf.indexOf(0x697320), 4);
594 assert.strictEqual(buf.indexOf(0x69732069), 2);
595 assert.strictEqual(buf.indexOf(0x697374657374), 0);
596 assert.strictEqual(buf.indexOf(0x69737374), 0);
597 assert.strictEqual(buf.indexOf(0x69737465), 11);
598 assert.strictEqual(buf.indexOf(0x69737465), 11);
599 assert.strictEqual(buf.indexOf(-140), 0);
600 assert.strictEqual(buf.indexOf(-152), 1);
601 assert.strictEqual(buf.indexOf(0xff), -1);
602 assert.strictEqual(buf.indexOf(0xffff), -1);
609 assert.strictEqual(haystack.indexOf(needle), 2);
610 assert.strictEqual(haystack.lastIndexOf(needle), haystack.length - 3);