Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/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 //CHECK#1
13 var non_w = "\f\n\r\t\v~`!@#$%^&*()-+={[}]|\\:;'<,>./? " + '"';
14 if (/\w/.exec(non_w) !== null) {
15 $ERROR('#1: non-w');
16 }
17
18 //CHECK#2
19 var non_W = "_0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
20 var regexp_w = /\w/g;
21 var k = 0;
22 while (regexp_w.exec(non_W) !== null) {
23 k++;
24 }
25
26 if (non_W.length !== k) {
27 $ERROR('#2: non-W');
28 }