Debian Codegraph @

js/src/tests/test262/built-ins/RegExp/S15.10.2.12_A3_T5.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 The production CharacterClassEscape :: w evaluates by returning the set of characters containing the sixty-three characters:
7 a - z, A - Z, 0 - 9, _
8 es5id: 15.10.2.12_A3_T5
9 description: non-w
10 ---*/
11
12 var non_w = "\f\n\r\t\v~`!@#$%^&*()-+={[}]|\\:;'<,>./? " + '"';
13
14 assert.sameValue(
15 /\w/.exec(non_w),
16 null,
17 '/w/.exec(""fnrtv~`!@#$%^&*()-+={[}]|:;\'<,>./? " + \'"\'") must return null'
18 );
19
20 var non_W = "_0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
21 var regexp_w = /\w/g;
22 var k = 0;
23 while (regexp_w.exec(non_W) !== null) {
24 k++;
25 }
26
27 assert.sameValue(non_W.length, k, 'The value of non_W.length is expected to equal the value of k');
28
29 reportCompare(0, 0);