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

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

Issue 3197010: Version 2.3.10... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 10 years, 4 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/cctest/test-heap-profiler.cc ('k') | test/mjsunit/shifts.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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 assertRegExpTest(/[,b]\Bb/, "bb", true); 477 assertRegExpTest(/[,b]\Bb/, "bb", true);
478 assertRegExpTest(/[,b]\bb/, ",b", true); 478 assertRegExpTest(/[,b]\bb/, ",b", true);
479 assertRegExpTest(/[,b]\Bb/, ",b", false); 479 assertRegExpTest(/[,b]\Bb/, ",b", false);
480 480
481 assertRegExpTest(/[,b]\b[,b]/, "bb", false); 481 assertRegExpTest(/[,b]\b[,b]/, "bb", false);
482 assertRegExpTest(/[,b]\B[,b]/, "bb", true); 482 assertRegExpTest(/[,b]\B[,b]/, "bb", true);
483 assertRegExpTest(/[,b]\b[,b]/, ",b", true); 483 assertRegExpTest(/[,b]\b[,b]/, ",b", true);
484 assertRegExpTest(/[,b]\B[,b]/, ",b", false); 484 assertRegExpTest(/[,b]\B[,b]/, ",b", false);
485 assertRegExpTest(/[,b]\b[,b]/, "b,", true); 485 assertRegExpTest(/[,b]\b[,b]/, "b,", true);
486 assertRegExpTest(/[,b]\B[,b]/, "b,", false); 486 assertRegExpTest(/[,b]\B[,b]/, "b,", false);
487
488 // Test that caching of result doesn't share result objects.
489 // More iterations increases the chance of hitting a GC.
490 for (var i = 0; i < 100; i++) {
491 var re = /x(y)z/;
492 var res = re.exec("axyzb");
493 assertTrue(!!res);
494 assertEquals(2, res.length);
495 assertEquals("xyz", res[0]);
496 assertEquals("y", res[1]);
497 assertEquals(1, res.index);
498 assertEquals("axyzb", res.input);
499 assertEquals(undefined, res.foobar);
500
501 res.foobar = "Arglebargle";
502 res[3] = "Glopglyf";
503 assertEquals("Arglebargle", res.foobar);
504 }
OLDNEW
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | test/mjsunit/shifts.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698