Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / RegExp / S15.10.2.10_A4.1_T3.js
blobe10f55ec2711df7aad916e2702f8119389fd19a8
1 // Copyright 2009 the Sputnik authors.  All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 info: |
6     CharacterEscape :: UnicodeEscapeSequence :: u HexDigit HexDigit HexDigit
7     HexDigit
8 es5id: 15.10.2.10_A4.1_T3
9 description: >
10     Tested string include RUSSIAN CAPITAL ALPHABET and russian small
11     alphabet in unicode notation
12 ---*/
14 var hex = ["\\u0410", "\\u0411", "\\u0412", "\\u0413", "\\u0414", "\\u0415", "\\u0416", "\\u0417", "\\u0418", "\\u0419", "\\u041A", "\\u041B", "\\u041C", "\\u041D", "\\u041E", "\\u041F", "\\u0420", "\\u0421", "\\u0422", "\\u0423", "\\u0424", "\\u0425", "\\u0426", "\\u0427", "\\u0428", "\\u0429", "\\u042A", "\\u042B", "\\u042C", "\\u042D", "\\u042E", "\\u042F", "\\u0401"];
15 var character = ["\u0410", "\u0411", "\u0412", "\u0413", "\u0414", "\u0415", "\u0416", "\u0417", "\u0418", "\u0419", "\u041A", "\u041B", "\u041C", "\u041D", "\u041E", "\u041F", "\u0420", "\u0421", "\u0422", "\u0423", "\u0424", "\u0425", "\u0426", "\u0427", "\u0428", "\u0429", "\u042A", "\u042B", "\u042C", "\u042D", "\u042E", "\u042F", "\u0401"];
16 var result = true;
17 for (var index = 0; index < hex.length; index++) {
18   var arr = (new RegExp(hex[index])).exec(character[index]); 
19   if ((arr === null) || (arr[0] !== character[index])) {
20     result = false;
21   }
24 assert.sameValue(result, true, 'The value of result is expected to be true');
26 hex = ["\\u0430", "\\u0431", "\\u0432", "\\u0433", "\\u0434", "\\u0435", "\\u0436", "\\u0437", "\\u0438", "\\u0439", "\\u043A", "\\u043B", "\\u043C", "\\u043D", "\\u043E", "\\u043F", "\\u0440", "\\u0441", "\\u0442", "\\u0443", "\\u0444", "\\u0445", "\\u0446", "\\u0447", "\\u0448", "\\u0449", "\\u044A", "\\u044B", "\\u044C", "\\u044D", "\\u044E", "\\u044F", "\\u0451"];
27 character = ["\u0430", "\u0431", "\u0432", "\u0433", "\u0434", "\u0435", "\u0436", "\u0437", "\u0438", "\u0439", "\u043A", "\u043B", "\u043C", "\u043D", "\u043E", "\u043F", "\u0440", "\u0441", "\u0442", "\u0443", "\u0444", "\u0445", "\u0446", "\u0447", "\u0448", "\u0449", "\u044A", "\u044B", "\u044C", "\u044D", "\u044E", "\u044F", "\u0451"];
28 var result = true;
29 for (index = 0; index < hex.length; index++) {
30   arr = (new RegExp(hex[index])).exec(character[index]); 
31   if ((arr === null) || (arr[0] !== character[index])) {
32     result = false;
33   }
36 assert.sameValue(result, true, 'The value of result is expected to be true');
38 reportCompare(0, 0);