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

Unified Diff: test/mjsunit/third_party/regexp-pcre/regexp-pcre.js

Issue 1544793002: [tests] Fix bogus uses of assertThrows. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/regress/regress-70066.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/third_party/regexp-pcre/regexp-pcre.js
diff --git a/test/mjsunit/third_party/regexp-pcre/regexp-pcre.js b/test/mjsunit/third_party/regexp-pcre/regexp-pcre.js
index c049fb4d0923c33594fd5a1504348f3968851332..68b8f0525b848ed7a0f8d9ef736ebc19dc65414e 100644
--- a/test/mjsunit/third_party/regexp-pcre/regexp-pcre.js
+++ b/test/mjsunit/third_party/regexp-pcre/regexp-pcre.js
@@ -1657,19 +1657,19 @@ assertNull(res[2].exec("Adefabc", 10));
assertToStringEquals("abc", res[7].exec("abc"), 11);
assertNull(res[7].exec("*** Failers", 12));
assertNull(res[7].exec("def\nabc", 13));
-assertThrows("var re = /x{5,4}/;", 14);
-assertThrows("var re = /[abcd/;", 15);
-assertThrows("var re = /[z-a]/;", 16);
-assertThrows("var re = /^*/;", 17);
-assertThrows("var re = /(abc/;", 18);
-assertThrows("var re = /(?# abc/;", 19);
+assertThrows("var re = /x{5,4}/;");
+assertThrows("var re = /[abcd/;");
+assertThrows("var re = /[z-a]/;");
+assertThrows("var re = /^*/;");
+assertThrows("var re = /(abc/;");
+assertThrows("var re = /(?# abc/;");
assertToStringEquals("cat", res[11].exec("this sentence eventually mentions a cat"), 20);
assertToStringEquals("elephant", res[11].exec("this sentences rambles on and on for a while and then reaches elephant"), 21);
assertToStringEquals("cat", res[12].exec("this sentence eventually mentions a cat"), 22);
assertToStringEquals("elephant", res[12].exec("this sentences rambles on and on for a while and then reaches elephant"), 23);
assertToStringEquals("CAT", res[13].exec("this sentence eventually mentions a CAT cat"), 24);
assertToStringEquals("elephant", res[13].exec("this sentences rambles on and on for a while to elephant ElePhant"), 25);
-assertThrows("var re = /{4,5}abc/;", 26);
+assertThrows("var re = /{4,5}abc/;");
assertToStringEquals("abcb,a,b,c", res[18].exec("abcb"), 27);
assertToStringEquals("abcb,a,b,c", res[18].exec("O0abcb"), 28);
assertToStringEquals("abcb,a,b,c", res[18].exec("O3abcb"), 29);
@@ -1712,7 +1712,7 @@ assertNull(res[30].exec("abc\ndef", 65));
assertToStringEquals("abc", res[31].exec("abc"), 66);
assertNull(res[31].exec("abc\n", 67));
assertToStringEquals("abc,abc", res[33].exec("abc"), 68);
-assertThrows("var re = /)/;", 69);
+assertThrows("var re = /)/;");
assertToStringEquals("-pr", res[35].exec("co-processors, and for"), 70);
assertToStringEquals("<def>ghi<klm>", res[36].exec("abc<def>ghi<klm>nop"), 71);
assertToStringEquals("<def>", res[37].exec("abc<def>ghi<klm>nop"), 72);
@@ -1772,28 +1772,28 @@ assertNull(res[45].exec("fooabar", 125));
assertNull(res[46].exec("*** Failers", 126));
assertNull(res[46].exec("a", 127));
assertNull(res[48].exec("aaaaaa", 128));
-assertThrows("var re = /a[b-a]/;", 129);
-assertThrows("var re = /a[/;", 130);
-assertThrows("var re = /*a/;", 131);
-assertThrows("var re = /abc)/;", 132);
-assertThrows("var re = /(abc/;", 133);
-assertThrows("var re = /a**/;", 134);
-assertThrows("var re = /)(/;", 135);
-assertThrows("var re = /a[b-a]/;", 136);
-assertThrows("var re = /a[/;", 137);
-assertThrows("var re = /*a/;", 138);
-assertThrows("var re = /abc)/;", 139);
-assertThrows("var re = /(abc/;", 140);
-assertThrows("var re = /a**/;", 141);
-assertThrows("var re = /)(/;", 142);
-assertThrows("var re = /:(?:/;", 143);
-assertThrows("var re = /a(?{)b/;", 144);
-assertThrows("var re = /a(?{{})b/;", 145);
-assertThrows("var re = /a(?{}})b/;", 146);
-assertThrows("var re = /a(?{\"{\"})b/;", 147);
-assertThrows("var re = /a(?{\"{\"}})b/;", 148);
-assertThrows("var re = /[a[:xyz:/;", 149);
-assertThrows("var re = /a{37,17}/;", 150);
+assertThrows("var re = /a[b-a]/;");
+assertThrows("var re = /a[/;");
+assertThrows("var re = /*a/;");
+assertThrows("var re = /abc)/;");
+assertThrows("var re = /(abc/;");
+assertThrows("var re = /a**/;");
+assertThrows("var re = /)(/;");
+assertThrows("var re = /a[b-a]/;");
+assertThrows("var re = /a[/;");
+assertThrows("var re = /*a/;");
+assertThrows("var re = /abc)/;");
+assertThrows("var re = /(abc/;");
+assertThrows("var re = /a**/;");
+assertThrows("var re = /)(/;");
+assertThrows("var re = /:(?:/;");
+assertThrows("var re = /a(?{)b/;");
+assertThrows("var re = /a(?{{})b/;");
+assertThrows("var re = /a(?{}})b/;");
+assertThrows("var re = /a(?{\"{\"})b/;");
+assertThrows("var re = /a(?{\"{\"}})b/;");
+assertThrows("var re = /[a[:xyz:/;");
+assertThrows("var re = /a{37,17}/;");
assertToStringEquals("abcd,a,d", res[58].exec("abcd"), 151);
assertToStringEquals("abcd,a,d", res[58].exec("abcdC2"), 152);
assertToStringEquals("abcd,a,d", res[58].exec("abcdC5"), 153);
@@ -1884,7 +1884,7 @@ assertNull(res[147].exec("aB", 237));
assertNull(res[147].exec("*** Failers", 238));
assertNull(res[147].exec("Ab", 239));
assertNull(res[147].exec("AB", 240));
-assertThrows("var re = /[\\200-\\110]/;", 241);
+assertThrows("var re = /[\\200-\\110]/;");
assertToStringEquals("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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC,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 ,72 ,73 ,74 ,75 ,76 ,77 ,78 ,79 ,80 ,81 ,82 ,83 ,84 ,85 ,86 ,87 ,88 ,89 ,90 ,91 ,92 ,93 ,94 ,95 ,96 ,97 ,98 ,99 ,100 ,101 ,102 ,103 ,104 ,105 ,106 ,107 ,108 ,109 ,110 ,111 ,112 ,113 ,114 ,115 ,116 ,117 ,118 ,119 ,120 ,121 ,122 ,123 ,124 ,125 ,126 ,127 ,128 ,129 ,130 ,131 ,132 ,133 ,134 ,135 ,136 ,137 ,138 ,139 ,140 ,141 ,142 ,143 ,144 ,145 ,146 ,147 ,148 ,149 ,150 ,151 ,152 ,153 ,154 ,155 ,156 ,157 ,158 ,159 ,160 ,161 ,162 ,163 ,164 ,165 ,166 ,167 ,168 ,169 ,170 ,171 ,172 ,173 ,174 ,175 ,176 ,177 ,178 ,179 ,180 ,181 ,182 ,183 ,184 ,185 ,186 ,187 ,188 ,189 ,190 ,191 ,192 ,193 ,194 ,195 ,196 ,197 ,198 ,199 ,200 ,201 ,202 ,203 ,204 ,205 ,206 ,207 ,208 ,209 ,210 ,211 ,212 ,213 ,214 ,215 ,216 ,217 ,218 ,219 ,220 ,221 ,222 ,223 ,224 ,225 ,226 ,227 ,228 ,229 ,230 ,231 ,232 ,233 ,234 ,235 ,236 ,237 ,238 ,239 ,240 ,241 ,242 ,243 ,244 ,245 ,246 ,247 ,248 ,249 ,250 ,251 ,252 ,253 ,254 ,255 ,256 ,257 ,258 ,259 ,260 ,261 ,262 ,263 ,264 ,265 ,266 ,267 ,268 ,269 ,ABC,ABC", res[149].exec("O900 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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC"), 242);
assertToStringEquals("mainmain,main,", res[151].exec("mainmain"), 243);
assertToStringEquals("mainOmain,main,", res[151].exec("mainOmain"), 244);
@@ -1902,7 +1902,7 @@ assertToStringEquals("aabbaa,", res[163].exec("aabbaa"), 255);
assertToStringEquals("aabbbaa,", res[164].exec("aabbbaa"), 256);
assertToStringEquals("aabbbaa,aa,,", res[165].exec("aabbbaa"), 257);
assertToStringEquals("aabbbbaa,aa,,", res[166].exec("aabbbbaa"), 258);
-assertThrows("var re = //;", 259);
+assertThrows("var re = //;");
assertToStringEquals("a", res[169].exec("ab"), 260);
assertToStringEquals("a", res[169].exec("aB"), 261);
assertToStringEquals("*", res[169].exec("*** Failers"), 262);
@@ -1930,8 +1930,8 @@ assertNull(res[177].exec("*** Failers", 283));
assertNull(res[177].exec("((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 284));
assertNull(res[177].exec("xaaaab", 285));
assertNull(res[177].exec("xaaaab", 286));
-assertThrows("var re = /[/;", 287);
-assertThrows("var re = /[a-/;", 288);
+assertThrows("var re = /[/;");
+assertThrows("var re = /[a-/;");
assertNull(res[189].exec("<>", 289));
assertNull(res[189].exec("<abcd>", 290));
assertNull(res[189].exec("<abc <123> hij>", 291));
@@ -2111,7 +2111,7 @@ assertNull(res[255].exec("AbCd", 464));
assertNull(res[255].exec("** Failers", 465));
assertNull(res[255].exec("abcd", 466));
// We are compatible with JSC, and don't throw an exception in this case.
-// assertThrows("var re = /(){2,4294967295}/;", 467);
+// assertThrows("var re = /(){2,4294967295}/;");
assertNull(res[255].exec("abcdefghijklAkB", 468));
assertNull(res[255].exec("abcdefghijklAkB", 469));
assertNull(res[255].exec("abcdefghijklAkB", 470));
@@ -2230,7 +2230,7 @@ assertToStringEquals("x", res[350].exec("x"), 582);
assertToStringEquals("ab", res[350].exec("abcabc"), 583);
assertToStringEquals("Xaaa,a", res[351].exec("Xaaa"), 584);
assertToStringEquals("Xaba,a", res[351].exec("Xaba"), 585);
-assertThrows("var re = /^[a-\\Q\\E]/;", 586);
+assertThrows("var re = /^[a-\\Q\\E]/;");
assertNull(res[353].exec("(xy)x", 587));
assertNull(res[353].exec("1221", 588));
assertNull(res[353].exec("Satan, oscillate my metallic sonatas!", 589));
@@ -2353,13 +2353,13 @@ assertToStringEquals("abc1", res[378].exec("abc1\n abc2\x0b abc3\x0c abc4\x0d ab
assertToStringEquals("X", res[379].exec("XABC"), 706);
assertNull(res[379].exec("** Failers ", 707));
assertToStringEquals("X", res[379].exec("XABCB"), 708);
-assertThrows("var re = /(ab|c)(?-1)/;", 709);
+assertThrows("var re = /(ab|c)(?-1)/;");
assertNull(res[379].exec("abc", 710));
assertNull(res[379].exec("xyabcabc", 711));
assertNull(res[379].exec("** Failers", 712));
assertNull(res[379].exec("xyabc ", 713));
-assertThrows("var re = /x(?-0)y/;", 714);
-assertThrows("var re = /x(?-1)y/;", 715);
+assertThrows("var re = /x(?-0)y/;");
+assertThrows("var re = /x(?-1)y/;");
assertNull(res[379].exec("abcX", 716));
assertNull(res[379].exec("Y", 717));
assertNull(res[379].exec("** Failers", 718));
@@ -2379,14 +2379,14 @@ assertNull(res[382].exec("** Failers", 731));
assertNull(res[382].exec("tom-bon ", 732));
assertNull(res[382].exec("tom-tom", 733));
assertNull(res[382].exec("bon-bon ", 734));
-assertThrows("var re = /(?|(abc)|(xyz))/;", 735);
-assertThrows("var re = /(x)(?|(abc)|(xyz))(x)/;", 736);
+assertThrows("var re = /(?|(abc)|(xyz))/;");
+assertThrows("var re = /(x)(?|(abc)|(xyz))(x)/;");
assertNull(res[383].exec("xabcx", 737));
assertNull(res[383].exec("xxyzx ", 738));
-assertThrows("var re = /(x)(?|(abc)(pqr)|(xyz))(x)/;", 739);
+assertThrows("var re = /(x)(?|(abc)(pqr)|(xyz))(x)/;");
assertNull(res[383].exec("xabcpqrx", 740));
assertNull(res[383].exec("xxyzx ", 741));
-assertThrows("var re = /(?|(abc)|(xyz))\\1/;", 742);
+assertThrows("var re = /(?|(abc)|(xyz))\\1/;");
assertNull(res[383].exec("abcabc", 743));
assertNull(res[383].exec("xyzxyz ", 744));
assertNull(res[383].exec("** Failers", 745));
@@ -2528,7 +2528,7 @@ assertNull(res[431].exec("a\x85b", 880));
assertNull(res[431].exec("a\nb", 881));
assertNull(res[431].exec("a\x0db ", 882));
assertNull(res[431].exec("a\x85b", 883));
-assertThrows("var re = /(?-+a)/;", 884);
+assertThrows("var re = /(?-+a)/;");
assertNull(res[443].exec("aaaa", 885));
assertNull(res[443].exec("bacxxx", 886));
assertNull(res[443].exec("bbaccxxx ", 887));
@@ -4082,7 +4082,7 @@ assertToStringEquals("bababc,ba", res[808].exec("bababc"), 2434);
assertNull(res[808].exec("*** Failers", 2435));
assertNull(res[808].exec("bababbc", 2436));
assertNull(res[808].exec("babababc", 2437));
-assertThrows("var re = /^\\ca\\cA\\c[\\c{\\c:/;", 2438);
+assertThrows("var re = /^\\ca\\cA\\c[\\c{\\c:/;");
assertNull(res[808].exec("\x01\x01e;z", 2439));
assertToStringEquals("a", res[809].exec("athing"), 2440);
assertToStringEquals("b", res[809].exec("bthing"), 2441);
@@ -4478,7 +4478,7 @@ assertToStringEquals(".23,.23,", res[925].exec("1.230003938 "), 2830);
assertToStringEquals(".875,.875,5", res[925].exec("1.875000282"), 2831);
assertNull(res[925].exec("*** Failers ", 2832));
assertNull(res[925].exec("1.235 ", 2833));
-assertThrows("var re = /a(?)b/;", 2834);
+assertThrows("var re = /a(?)b/;");
assertNull(res[925].exec("ab ", 2835));
assertToStringEquals("foo table,foo,table", res[926].exec("Food is on the foo table"), 2836);
assertToStringEquals("food is under the bar in the bar,d is under the bar in the ", res[927].exec("The food is under the bar in the barn."), 2837);
@@ -4625,7 +4625,7 @@ assertToStringEquals("\"the \\\"quick\\\" brown fox\", brown fox", res[983].exec
assertToStringEquals("", res[984].exec("abc"), 2978);
assertToStringEquals("", res[985].exec("abc "), 2979);
assertToStringEquals("", res[986].exec("abc "), 2980);
-assertThrows("var re = //;", 2981);
+assertThrows("var re = //;");
assertToStringEquals("", res[986].exec("abc"), 2982);
assertToStringEquals("acb", res[988].exec("acb"), 2983);
assertToStringEquals("a\nb", res[988].exec("a\nb"), 2984);
@@ -5593,11 +5593,11 @@ assertToStringEquals("X", res[1330].exec("XABCB"), 3945);
assertNull(res[1330].exec("abc\x0d\n\x0d\n", 3946));
assertNull(res[1330].exec("abc\x0d\n\x0d\n", 3947));
assertNull(res[1330].exec("abc\x0d\n\x0d\n", 3948));
-assertThrows("var re = /(?|(abc)|(xyz))/;", 3949);
-assertThrows("var re = /(x)(?|(abc)|(xyz))(x)/;", 3950);
+assertThrows("var re = /(?|(abc)|(xyz))/;");
+assertThrows("var re = /(x)(?|(abc)|(xyz))(x)/;");
assertNull(res[1330].exec("xabcx", 3951));
assertNull(res[1330].exec("xxyzx ", 3952));
-assertThrows("var re = /(x)(?|(abc)(pqr)|(xyz))(x)/;", 3953);
+assertThrows("var re = /(x)(?|(abc)(pqr)|(xyz))(x)/;");
assertNull(res[1330].exec("xabcpqrx", 3954));
assertNull(res[1330].exec("xxyzx ", 3955));
assertNull(res[1330].exec("abcabc", 3956));
@@ -6600,4 +6600,4 @@ assertNull(res[1546].exec("x{1d79}x{a77d} ", 4952));
assertNull(res[1546].exec("x{a77d}x{1d79}", 4953));
assertNull(res[1546].exec("** Failers ", 4954));
assertNull(res[1546].exec("x{1d79}x{a77d} ", 4955));
-assertThrows("var re = //;", 4956);
+assertThrows("var re = //;");
« no previous file with comments | « test/mjsunit/regress/regress-70066.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698