Lines Matching refs:includes
12 assert(b.includes('a'));
13 assert(!b.includes('a', 1));
14 assert(!b.includes('a', -1));
15 assert(!b.includes('a', -4));
16 assert(b.includes('a', -b.length));
17 assert(b.includes('a', NaN));
18 assert(b.includes('a', -Infinity));
19 assert(!b.includes('a', Infinity));
20 assert(b.includes('bc'));
21 assert(!b.includes('bc', 2));
22 assert(!b.includes('bc', -1));
23 assert(!b.includes('bc', -3));
24 assert(b.includes('bc', -5));
25 assert(b.includes('bc', NaN));
26 assert(b.includes('bc', -Infinity));
27 assert(!b.includes('bc', Infinity));
28 assert(b.includes('f'), b.length - 1);
29 assert(!b.includes('z'));
30 assert(b.includes(''));
31 assert(b.includes('', 1));
32 assert(b.includes('', b.length + 1));
33 assert(b.includes('', Infinity));
34 assert(b.includes(buf_a));
35 assert(!b.includes(buf_a, 1));
36 assert(!b.includes(buf_a, -1));
37 assert(!b.includes(buf_a, -4));
38 assert(b.includes(buf_a, -b.length));
39 assert(b.includes(buf_a, NaN));
40 assert(b.includes(buf_a, -Infinity));
41 assert(!b.includes(buf_a, Infinity));
42 assert(b.includes(buf_bc));
43 assert(!b.includes(buf_bc, 2));
44 assert(!b.includes(buf_bc, -1));
45 assert(!b.includes(buf_bc, -3));
46 assert(b.includes(buf_bc, -5));
47 assert(b.includes(buf_bc, NaN));
48 assert(b.includes(buf_bc, -Infinity));
49 assert(!b.includes(buf_bc, Infinity));
50 assert(b.includes(buf_f), b.length - 1);
51 assert(!b.includes(buf_z));
52 assert(b.includes(buf_empty));
53 assert(b.includes(buf_empty, 1));
54 assert(b.includes(buf_empty, b.length + 1));
55 assert(b.includes(buf_empty, Infinity));
56 assert(b.includes(0x61));
57 assert(!b.includes(0x61, 1));
58 assert(!b.includes(0x61, -1));
59 assert(!b.includes(0x61, -4));
60 assert(b.includes(0x61, -b.length));
61 assert(b.includes(0x61, NaN));
62 assert(b.includes(0x61, -Infinity));
63 assert(!b.includes(0x61, Infinity));
64 assert(!b.includes(0x0));
67 assert(b.includes('d', 2));
68 assert(b.includes('f', 5));
69 assert(b.includes('f', -1));
70 assert(!b.includes('f', 6));
72 assert(b.includes(Buffer.from('d'), 2));
73 assert(b.includes(Buffer.from('f'), 5));
74 assert(b.includes(Buffer.from('f'), -1));
75 assert(!b.includes(Buffer.from('f'), 6));
77 assert(!Buffer.from('ff').includes(Buffer.from('f'), 1, 'ucs2'));
82 .includes('64', 0, 'hex'),
87 .includes(Buffer.from('64', 'hex'), 0, 'hex'),
94 .includes('ZA==', 0, 'base64'),
99 .includes(Buffer.from('ZA==', 'base64'), 0, 'base64'),
106 .includes('d', 0, 'ascii'),
111 .includes(Buffer.from('d', 'ascii'), 0, 'ascii'),
118 .includes('d', 0, 'latin1'),
123 .includes(Buffer.from('d', 'latin1'), 0, 'latin1'),
130 .includes('d', 0, 'binary'),
135 .includes(Buffer.from('d', 'binary'), 0, 'binary'),
143 assert(twoByteString.includes('\u0395', 4, 'ucs2'));
144 assert(twoByteString.includes('\u03a3', -4, 'ucs2'));
145 assert(twoByteString.includes('\u03a3', -6, 'ucs2'));
146 assert(twoByteString.includes(
148 assert(!twoByteString.includes('\u03a3', -2, 'ucs2'));
152 assert(mixedByteStringUcs2.includes('bc', 0, 'ucs2'));
153 assert(mixedByteStringUcs2.includes('\u03a3', 0, 'ucs2'));
154 assert(!mixedByteStringUcs2.includes('\u0396', 0, 'ucs2'));
157 mixedByteStringUcs2.includes(Buffer.from('bc', 'ucs2'), 0, 'ucs2'));
159 mixedByteStringUcs2.includes(Buffer.from('\u03a3', 'ucs2'), 0, 'ucs2'));
161 !mixedByteStringUcs2.includes(Buffer.from('\u0396', 'ucs2'), 0, 'ucs2'));
166 assert(twoByteString.includes('\u039a', 0, 'ucs2'));
167 assert(twoByteString.includes('\u0391', 0, 'ucs2'), 'Alpha');
168 assert(twoByteString.includes('\u03a3', 0, 'ucs2'), 'First Sigma');
169 assert(twoByteString.includes('\u03a3', 6, 'ucs2'), 'Second Sigma');
170 assert(twoByteString.includes('\u0395', 0, 'ucs2'), 'Epsilon');
171 assert(!twoByteString.includes('\u0392', 0, 'ucs2'), 'Not beta');
174 assert(twoByteString.includes('\u039a\u0391', 0, 'ucs2'), 'Lambda Alpha');
175 assert(twoByteString.includes('\u0391\u03a3', 0, 'ucs2'), 'Alpha Sigma');
176 assert(twoByteString.includes('\u03a3\u03a3', 0, 'ucs2'), 'Sigma Sigma');
177 assert(twoByteString.includes('\u03a3\u0395', 0, 'ucs2'), 'Sigma Epsilon');
180 assert(mixedByteStringUtf8.includes('bc'));
181 assert(mixedByteStringUtf8.includes('bc', 5));
182 assert(mixedByteStringUtf8.includes('bc', -8));
183 assert(mixedByteStringUtf8.includes('\u03a3'));
184 assert(!mixedByteStringUtf8.includes('\u0396'));
199 const includes = longBufferString.includes(pattern, i); constant
200 assert(includes, `Long ABACABA...-string at index ${i}`);
202 assert(longBufferString.includes('AJABACA'), 'Long AJABACA, First J');
203 assert(longBufferString.includes('AJABACA', 511), 'Long AJABACA, Second J');
206 assert(longBufferString.includes(pattern), 'Long JABACABA..., First J');
207 assert(longBufferString.includes(pattern, 512), 'Long JABACABA..., Second J');
212 assert(!asciiString.includes('\x2061'));
213 assert(asciiString.includes('leb', 0));
225 assert(!allCharsBufferUtf8.includes('notfound'));
226 assert(!allCharsBufferUcs2.includes('notfound'));
249 assert(index, allCharsBufferUtf8.includes(patternBufferUtf8));
252 assert(index, allCharsBufferUtf8.includes(patternStringUtf8));
267 allCharsBufferUcs2.includes(patternBufferUcs2, 0, 'ucs2'));
271 allCharsBufferUcs2.includes(patternStringUcs2, 0, 'ucs2'));
281 () => b.includes(val),
295 assert.ok(buf.includes(0x6973));
296 assert.ok(buf.includes(0x697320));
297 assert.ok(buf.includes(0x69732069));
298 assert.ok(buf.includes(0x697374657374));
299 assert.ok(buf.includes(0x69737374));
300 assert.ok(buf.includes(0x69737465));
301 assert.ok(buf.includes(0x69737465));
302 assert.ok(buf.includes(-140));
303 assert.ok(buf.includes(-152));
304 assert.ok(!buf.includes(0xff));
305 assert.ok(!buf.includes(0xffff));