summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/RegExp/unicode-ignoreCase-escape.js
blob: d731fb6bbe3122303dcbffa4b19602e8ba3faecd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
var BUGNUMBER = 1135377;
var summary = "Implement RegExp unicode flag -- ignoreCase flag with character class escape.";

// \W doesn't match S or K from the change in
// https://github.com/tc39/ecma262/pull/525
// (bug 1281739)

print(BUGNUMBER + ": " + summary);

// LATIN SMALL LETTER LONG S

assertEqArray(/\w/iu.exec("S"),
              ["S"]);
assertEqArray(/\w/iu.exec("s"),
              ["s"]);
assertEqArray(/\w/iu.exec("\u017F"),
              ["\u017F"]);

assertEqArray(/[^\W]/iu.exec("S"),
              ["S"]);
assertEqArray(/[^\W]/iu.exec("s"),
              ["s"]);
assertEqArray(/[^\W]/iu.exec("\u017F"),
              ["\u017F"]);

assertEq(/\W/iu.exec("S"),
         null);
assertEq(/\W/iu.exec("s"),
         null);
assertEq(/\W/iu.exec("\u017F"),
         null);

assertEq(/[^\w]/iu.exec("S"),
         null);
assertEq(/[^\w]/iu.exec("s"),
         null);
assertEq(/[^\w]/iu.exec("\u017F"),
         null);

// KELVIN SIGN

assertEqArray(/\w/iu.exec("k"),
              ["k"]);
assertEqArray(/\w/iu.exec("k"),
              ["k"]);
assertEqArray(/\w/iu.exec("\u212A"),
              ["\u212A"]);

assertEqArray(/[^\W]/iu.exec("k"),
              ["k"]);
assertEqArray(/[^\W]/iu.exec("k"),
              ["k"]);
assertEqArray(/[^\W]/iu.exec("\u212A"),
              ["\u212A"]);

assertEq(/\W/iu.exec("k"),
         null);
assertEq(/\W/iu.exec("k"),
         null);
assertEq(/\W/iu.exec("\u212A"),
         null);

assertEq(/[^\w]/iu.exec("k"),
         null);
assertEq(/[^\w]/iu.exec("k"),
         null);
assertEq(/[^\w]/iu.exec("\u212A"),
         null);

if (typeof reportCompare === "function")
    reportCompare(true, true);