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

Side by Side Diff: test/cctest/test-regexp.cc

Issue 5703001: Revert 5911 (RegExp fail on invalid range syntax).
Patch Set: Created 10 years 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
« no previous file with comments | « src/parser.cc ('k') | test/mjsunit/regexp.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 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 CHECK_PARSE_EQ("[x]", "[x]"); 166 CHECK_PARSE_EQ("[x]", "[x]");
167 CHECK_PARSE_EQ("[xyz]", "[x y z]"); 167 CHECK_PARSE_EQ("[xyz]", "[x y z]");
168 CHECK_PARSE_EQ("[a-zA-Z0-9]", "[a-z A-Z 0-9]"); 168 CHECK_PARSE_EQ("[a-zA-Z0-9]", "[a-z A-Z 0-9]");
169 CHECK_PARSE_EQ("[-123]", "[- 1 2 3]"); 169 CHECK_PARSE_EQ("[-123]", "[- 1 2 3]");
170 CHECK_PARSE_EQ("[^123]", "^[1 2 3]"); 170 CHECK_PARSE_EQ("[^123]", "^[1 2 3]");
171 CHECK_PARSE_EQ("]", "']'"); 171 CHECK_PARSE_EQ("]", "']'");
172 CHECK_PARSE_EQ("}", "'}'"); 172 CHECK_PARSE_EQ("}", "'}'");
173 CHECK_PARSE_EQ("[a-b-c]", "[a-b - c]"); 173 CHECK_PARSE_EQ("[a-b-c]", "[a-b - c]");
174 CHECK_PARSE_EQ("[\\d]", "[0-9]"); 174 CHECK_PARSE_EQ("[\\d]", "[0-9]");
175 CHECK_PARSE_EQ("[x\\dz]", "[x 0-9 z]"); 175 CHECK_PARSE_EQ("[x\\dz]", "[x 0-9 z]");
176 CHECK_PARSE_EQ("[\\d-z]", "[0-9 - z]");
177 CHECK_PARSE_EQ("[\\d-\\d]", "[0-9 - 0-9]");
178 CHECK_PARSE_EQ("[z-\\d]", "[z - 0-9]");
176 CHECK_PARSE_EQ("\\cj\\cJ\\ci\\cI\\ck\\cK", 179 CHECK_PARSE_EQ("\\cj\\cJ\\ci\\cI\\ck\\cK",
177 "'\\x0a\\x0a\\x09\\x09\\x0b\\x0b'"); 180 "'\\x0a\\x0a\\x09\\x09\\x0b\\x0b'");
178 CHECK_PARSE_EQ("\\c!", "'c!'"); 181 CHECK_PARSE_EQ("\\c!", "'c!'");
179 CHECK_PARSE_EQ("\\c_", "'c_'"); 182 CHECK_PARSE_EQ("\\c_", "'c_'");
180 CHECK_PARSE_EQ("\\c~", "'c~'"); 183 CHECK_PARSE_EQ("\\c~", "'c~'");
181 CHECK_PARSE_EQ("[a\\]c]", "[a ] c]"); 184 CHECK_PARSE_EQ("[a\\]c]", "[a ] c]");
182 CHECK_PARSE_EQ("\\[\\]\\{\\}\\(\\)\\%\\^\\#\\ ", "'[]{}()%^# '"); 185 CHECK_PARSE_EQ("\\[\\]\\{\\}\\(\\)\\%\\^\\#\\ ", "'[]{}()%^# '");
183 CHECK_PARSE_EQ("[\\[\\]\\{\\}\\(\\)\\%\\^\\#\\ ]", "[[ ] { } ( ) % ^ # ]"); 186 CHECK_PARSE_EQ("[\\[\\]\\{\\}\\(\\)\\%\\^\\#\\ ]", "[[ ] { } ( ) % ^ # ]");
184 CHECK_PARSE_EQ("\\0", "'\\x00'"); 187 CHECK_PARSE_EQ("\\0", "'\\x00'");
185 CHECK_PARSE_EQ("\\8", "'8'"); 188 CHECK_PARSE_EQ("\\8", "'8'");
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 bool in_second = CharacterInSet(&l2, i); 1776 bool in_second = CharacterInSet(&l2, i);
1774 CHECK((in_first || in_second) == CharacterInSet(&all, i)); 1777 CHECK((in_first || in_second) == CharacterInSet(&all, i));
1775 } 1778 }
1776 } 1779 }
1777 1780
1778 1781
1779 TEST(Graph) { 1782 TEST(Graph) {
1780 V8::Initialize(NULL); 1783 V8::Initialize(NULL);
1781 Execute("\\b\\w+\\b", false, true, true); 1784 Execute("\\b\\w+\\b", false, true, true);
1782 } 1785 }
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | test/mjsunit/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698