Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/RegExp/S15.10.2.12_A4_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 all characters not
7 included in the set returned by CharacterClassEscape :: w
8 es5id: 15.10.2.12_A4_T5
9 description: non-w
10 ---*/
11
12 //CHECK#1
13 var non_w = "\f\n\r\t\v~`!@#$%^&*()-+={[}]|\\:;'<,>./? " + '"';
14 var regexp_W = /\W/g;
15 var k = 0;
16 while (regexp_W.exec(non_w) !== null) {
17 k++;
18 }
19
20 if (non_w.length !== k) {
21 $ERROR('#1: non-w');
22 }
23
24 //CHECK#2
25 var non_W = "_0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
26 if (/\W/.exec(non_W) !== null) {
27 $ERROR('#2: non-W');
28 }