Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: test/mjsunit/cyrillic.js

Issue 6869007: Cleanup of mjsunit.js code and make assertEquals more strict. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/const.js ('k') | test/mjsunit/debug-scopes.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 var suffix = add_non_ascii_character_to_subject ? "\ufffe" : ""; 180 var suffix = add_non_ascii_character_to_subject ? "\ufffe" : "";
181 // A range that covers both ASCII and non-ASCII. 181 // A range that covers both ASCII and non-ASCII.
182 for (var i = 0; i < 2; i++) { 182 for (var i = 0; i < 2; i++) {
183 var full = (i != 0); 183 var full = (i != 0);
184 var mixed = full ? "[a-\uffff]" : "[a-" + cyrillic.LAST + "]"; 184 var mixed = full ? "[a-\uffff]" : "[a-" + cyrillic.LAST + "]";
185 var f = full ? "f" : "c"; 185 var f = full ? "f" : "c";
186 for (var j = 0; j < 2; j++) { 186 for (var j = 0; j < 2; j++) {
187 var ignore_case = (j == 0); 187 var ignore_case = (j == 0);
188 var flag = ignore_case ? "i" : ""; 188 var flag = ignore_case ? "i" : "";
189 var re = new RegExp(mixed, flag); 189 var re = new RegExp(mixed, flag);
190 assertEquals(ignore_case || (full && add_non_ascii_character_to_subject), 190 var expected =
191 re.test("A" + suffix), 191 ignore_case || (full && !!add_non_ascii_character_to_subject);
192 58 + flag + f); 192 assertEquals(expected, re.test("A" + suffix), 58 + flag + f);
193 assertTrue(re.test("a" + suffix), 59 + flag + f); 193 assertTrue(re.test("a" + suffix), 59 + flag + f);
194 assertTrue(re.test("~" + suffix), 60 + flag + f); 194 assertTrue(re.test("~" + suffix), 60 + flag + f);
195 assertTrue(re.test(cyrillic.MIDDLE), 61 + flag + f); 195 assertTrue(re.test(cyrillic.MIDDLE), 61 + flag + f);
196 assertEquals(ignore_case || full, re.test(cyrillic.middle), 62 + flag + f) ; 196 assertEquals(ignore_case || full, re.test(cyrillic.middle), 62 + flag + f) ;
197 } 197 }
198 } 198 }
199 } 199 }
OLDNEW
« no previous file with comments | « test/mjsunit/const.js ('k') | test/mjsunit/debug-scopes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698